Specifications
18. Scripting reference
18.1 Scripting API - Introduction
The Switch scripting API (application programming interface) provides script elements and script
expressions with access to information about the job (file or job folder) being processed, including
job ticket and metadata contents. Script expressions are limited to read-only access, while script
elements can update the information.
The scripting API supports three scripting languages: JavaScript, AppleScript, and VBScript. The
API documentation is provided in JavaScript syntax. Refer to AppleScript on page 139 and VBScript
on page 141 for information on how to adjust this syntax for the other scripting languages.
JavaScript language reference
The JavaScript language reference is provided as part of the scripting API documentation.
Scripting API Modules
The scripting API consists of a number of distinct modules, each of which publishes a set of
related classes and functions. Some modules are published only to the JavaScript scripting
language since AppleScript and VBScript offer their own built-in functionality in these areas.
AvailabilityDescriptionModule
Only JavaScriptReading and writing plain text files, enumerating files
in directories and executing command line
applications
Utility module
Text encoding, ByteArray class, File class, Dir class,
Process class
Only JavaScriptReading and writing XML files, including DOM and
XPath access to their contents and performing XSLT
transforms
XML module
Node class, Document class, Element class, Text class,
Comment class, Attr class, List classes
Only JavaScriptCommunicating with external applications and web
services through SOAP
Network module
SOAP class
Only JavaScriptAccessing external databases with SQL queries via ODBC
(Open Database Connectivity)
Database module
DataSource class, Statement class
367
Enfocus Switch 10