PATH
Previous | Chapter contents | Next | Book PDF
A scripting command can involve any object that is scriptable in any object hierarchy. The scripting system needs not only to get and set the data held by any scriptable object but to determine the objects that can be accessed from any particular scriptable object and what commands these objects support. For this reason, every scriptable application, framework, or bundle must publicly declare in an external data source the scriptable objects it exports. At runtime, this information is stored in a globally accessible repository of scripting metadata.
Scripting metadata consists of two general sorts of information: class descriptions and command descriptions. A class description describes the attributes and relationships of a scriptable class; "attribute" and "relationship," which are terms borrowed from database technology, correspond to "property" and "element" in AppleScript. Relationships can be of several kinds: one-to-one, one-to-many, or inverse. A class description also lists the commands a class supports and specifies whether a particular method of the class handles the command or the command's default implementation is used to execute the command. A description of a class can designate a scriptable superclass, and thus inherit the attributes, relationships, and supported commands of that class.
A command description defines the characteristics of an AppleScript command that the application, framework, or bundle specifically supports. This information includes the class of the command, the type of the return value, and the number and types of arguments. Many commands defined in the Core suite have default implementations in subclasses of NSScriptCommand. Descriptions of AppleScript commands are kept separate from specific classes since they are general to all described classes.
The scripting metadata for an application, framework, or bundle is referred to as a "suite." A file called a "suite definition" contains the language-independent information for a scriptable suite. It describes object attributes and relationships as well as commands using a structured format called a property list. In addition to a suite definition, a suite can have "suite terminologies" for localizing each supported dialect of AppleScript. A suite terminology maps specific AppleScript words and phrases in a particular language to attributes and relationships defined in the suite definition. See " Creating Suite Definitions and Suite Terminologies " for more on this subject.
When a Yellow Box application first needs to, it locates and loads (caches) all suite definitions and suite terminologies, not only its own but those of all imported frameworks and loaded bundles. (If it later loads a bundle dynamically, it loads any suites defined by the bundle.) It also registers class descriptions and command descriptions, making them globally available to the Apple event translator and any other interested client.
Previous | Chapter contents | Next | Book PDF