Using a script in Switch

To use a script package in Switch:


  1. Create and save the script package in SwitchScripter.
  2. Drag a script element onto the canvas in Switch.
  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.

Switch 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).