Specifications

Language reference
Refer to the Switch JavaScript language reference included with Switch help.
Extensions reference
Refer to the Scripting reference on page 367.
AppleScript
AppleScript scripting in Switch is intended primarily for communicating with other applications
or with operating systems services from within Switch. A script object representing the Switch
application provides access to key variables and functions, including the metadata context of
the job being processed. AppleScript scripting is available on Mac OS X only. Refer to the scripting
overview for more background information.
Language reference
Comprehensive reference and introductory information about AppleScript can be found on the
Apple web site (AppleScript) and in widely available literature.
AppleScript extensions reference
Switch provides a number of Switch-specific classes and functions to support accessing key Switch
variables and functions, including the metadata context of the job being processed. Refer to the
Switch scripting API for reference documentation about these extensions.
API differences
The Switch scripting API reference documentation uses the JavaScript syntax and semantics to
describe its various classes and functions. Unfortunately the AppleScript syntax and semantics
differ substantially from JavaScript (and most other scripting languages). Thus, while the
AppleScript API provides the same concepts and functionality, it has been adapted to the
AppleScript way.
Refer to the AppleScript dictionary included with the Switch server application for a brief
description of the AppleScript classes and methods it offers, and refer to the corresponding
sections in the scripting API reference for more extensive background information.
API restrictions
Not all of the classes and functions described in the scripting API are available when using
AppleScript. Specifically, the classes and functions in the "Utility", "XML", "Database" and
"Network" modules are not available. If you need the functionality in these modules, you have
to use AppleScript extensions included with the operating system or offered by third-parties.
Compiled binaries
Background
Before executing an AppleScript script, its source code must be compiled to a binary form. This
requires the presence of all of the script’s target applications because the compiler needs the
application-specific dictionaries. Sometimes accessing an application’s AppleScript dictionary
requires launching the application (as is the case for QuarkXPress, for example).
139
Enfocus Switch 10