Scripting Addition
A scripting addition is a code library, loaded by the AppleScript scripting component instance, that implements vocabulary extending the AppleScript language. Behind the scenes, communication with a scripting addition uses Apple events, just as does communication with a scriptable application. The difference, from the AppleScript programmer’s point of view, is a linguistic one: the scripting addition’s vocabulary is available to scripts compiled and run on that machine with no need to target any particular application. In other words, the extended vocabulary implemented by a scripting addition appears to the programmer to be built into AppleScript itself.
Scripting additions are typically written in a compiled lower-level language such as C. Their purpose is usually to bring to AppleScript some functionality that can be implemented in this lower-level language (possibly by calling into the Macintosh Toolbox) but is otherwise missing from AppleScript itself.
Tip
A scripting
addition on Mac OS 9 is a resource file of type
'osax‘. On Mac OS X it can also be a bundle with
extension .osax. A scripting addition is often
referred to as an
osax (plural osaxen).
On Mac OS 9, osaxen live in the System Folder, in its Scripting
Additions subfolder. On Mac OS X the supplied osaxen live in
/System/Library/ScriptingAdditions; the user may
add osaxen to /Library/ScriptingAdditions or to
~/Library/ScriptingAdditions, according to the
domain of their desired availability.
AppleScript ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access