Script package

A script package contains all of the information needed to execute a particular script program in the context of a script element. See scripting overview for more background information. Use the SwitchScripter development environment to create and edit script packages.

Format

A script package includes the following components:


A script package can contain multiple script programs, each program providing an implementation of the same functionality in a different scripting language. Since there is only one script declaration, from a semantic viewpoint a script package contains a single script even if it contains multiple implementations of the same functionality in different scripting languages.

All components of a script package are collected in a single file (stored as a ZIP archive) with the ".sscript" filename extension. Consequently a script package can be exchanged between users as a single entity.

Script declaration

The script declaration is 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 script program is a plain text file that contains the script program itself, written in one of the supported scripting languages. The syntax and semantics must conform to those of the chosen scripting language. The script program also relies on the Switch scripting API.

A script package may contain multiple script programs, each written in a different scripting language . In that case the Switch execution engine selects a language version in the following order:


If neither is present the script package cannot be executed on that operating system.

Although it is possible to have a script program for all three languages in a single script package, the JavaScript program would never be executed in that case (at least as long as Windows and Mac OS are the only supported platforms).

Icon

The optional script icon is a PNG image file (not interlaced) with a size of exactly 32x32 pixels in the RGB color space and with support for transparency. When a script package is associated with a script element, and the package contains an icon, the flow designer uses the icon to display the script element in the canvas. Otherwise the flow designer uses the default script element icon.

Password protection

A script package can be saved with a password. This means the script package can no longer be opened in SwitchScripter (for viewing or editing) without providing the same password. However the script package can still be executed by Switch. There is no way to block a script package from being executed.

The password protection allows a script author to distribute script packages without providing other parties with access to the script's source code (with an important exception – see the note below).

Note:

Important note: Certain Enfocus employees have access to the mechanism that bypasses the password protection (because even password-protected scripts can be executed and thus opened by Switch). While Enfocus does not intend to open password-protected scripts for viewing, and does not intend to publish the bypass mechanism, the company does not legally guarantee that this will never happen. It is important for script authors to understand the limitations of the protection.