Specifications

6. Press the "Save" tool button to save your script package with an appropriate name in a location
of your choice.
7. Verify the operation of your script as explained in "Testing a script", adjust the script and its
declaration as desired and save the final result.
Starting from an existing script
In most cases it makes a lot of sense to start developing the script from an example obtained
from the Enfocus web site or from another Switch user (see How to get more help on page 13
for pointers to these resources).
To start developing your script package from an existing example:
1. Copy the example script package file under a new name (so that the original is preserved);
do this in the system's file browser or by using the Save As menu item in SwitchScripter.
2. Double-click the copy to open it in SwitchScripter.
3. Adjust the configuration in the Declaration pane if needed (if the example is very similar to
the script, change the script's name and perhaps its icon).
4. Adjust the program text in the Program pane as desired.
5. Press the "Save" tool button to save the script package.
6. Verify operation of the script as explained in Testing a script on page 342, adjust the script
and its declaration as desired, and save the final result.
Using a script in PowerSwitch
To use a script package in PowerSwitch:
1. Create and save the script package in SwitchScripter.
2. Drag a script element onto the canvas in PowerSwitch.
3. Set the script element's "Script package" property to the file path of the script package.
4. Add the appropriate connections and configure any relevant properties for the script element
and its connections.
5. Activate the flow that contains the script element.
PowerSwitch retains just a reference to the script package (that is, it remembers the file's path
rather than the file itself). Each time the flow containing the script element is deactivated and
activated, the script package is reloaded afresh from the file. This means that the script package
can be modified and try again in a very short cycle.
Note:
In contrast, when a flow is exported, the exported ".sflow" file contains a full copy of the script
package file (that is, it is distributed with the flow).
341
Enfocus Switch 10