Specifications

Reading and writing XML files and performing XSLT transforms.
Executing a command line application.
Database access.
Webservices interaction.
JavaScript scripts have limited "external access". For example, there is no way to communicate
with interactive applications, and there is no access to operating system services.
JavaScript scripts are cross-platform, i.e. they work without change on both Mac OS X and Microsoft
Windows.
Script element and script expression
A script element is a flow element that encapsulates a script written in any of the supported
scripting languages. The script implements an “entry point” function called by Switch for each
job being processed through the flow element.
A script expression is a text string associated with a flow element property. To determine the
value of the property, Switch evaluates the contents of the string as a JavaScript expression in
the context of the job being processed. Only JavaScript is supported in script expressions.
The Switch scripting API (application programming interface) provides script elements and script
expressions with access to information about the job being processed, including job ticket and
metadata contents. Script expressions are limited to read-only access, while script elements can
update the information.
Script package
A script that is to be associated with a script element consists of the following components:
Script declaration: an XML file that specifies information about the script, such as the name
and data type of any properties (arguments) used by the script.
Script program: a plain text file that contains the script program itself, written in one of the
supported scripting languages.
Script icon: optionally, an icon that is used to display the script element in the Switch flow
designer.
These components are collected in a single file called a “script package” which is presented to
the script element as a single entity. This also allows creating “fat” packages containing an
implementation of the same functionality on multiple platforms.
Scripted plug-in
A scripted plug-in is a script package that, when saved with the appropriate password and placed
in the appropriate folder, behaves just like a tool or configurator built into Switch.
Scripted plug-ins are of no concern to regular Switch users. Enfocus may license selected
third-party vendors to develop scripted plug-ins.
Script development
PowerSwitch includes a script development environment called SwitchScripter, installed as a
separate application with the following major functions:
Create and edit Switch script packages and its components.
Emulate the Switch scripting API for testing purposes.
Setup specific input/output conditions for testing purposes.
131
Enfocus Switch 10