Previous | Chapter contents | Next | Book PDF
When the Apple event translator in the Yellow Box receives an Apple event that corresponds to a script command, it converts the Apple event (and associated data) to a script-command object (NSScriptCommand). Using the suite terminologies for all scriptable objects in the current application, the translator obtains the keys for these objects and uses them to extract data from the class descriptions and command descriptions loaded by that application (including suites of imported frameworks and loaded bundles).
With this data, it composes the script command. A script command has several components:
Because at this point the receivers and arguments are probably known only as AppleScript reference forms (for example, "word 5 of paragraph 3 of front document"), they are represented as nested "object specifiers" (that is, NSObjectSpecifier objects). The actual objects referenced by the object specifiers cannot be known until the command is executed within the context of the target application.
Once the Apple event translator has composed the script command, it sends the command to the application's NSScriptExecutionContext object, where it is executed. Command execution is not a simple procedure. It involves several steps:
Previous | Chapter contents | Next | Book PDF