Creating a new script

To create a new script package for Switch from a blank sheet:


  1. Launch SwitchScripter or, if it is already running, press the "Create new" tool button.
  2. The newly created script package is setup for JavaScript; skip the next step if Javascript alone is required; otherwise select choice of scripting language(s) as explained in the next step.
  3. In the Declaration pane, select the root element (representing the script as a whole) and set the "Include JavaScript/VBScript/AppleScript" properties according to your wishes (also see Selecting a scripting language).
  4. Use the Declaration pane to further configure the script declaration, including supported connections and injected properties.
  5. The Program pane has been initialized with a template (empty stubs) for the two most important entry points supported by the scripting API. Enter your custom program text inside the function body of the entry point(s) you need, remove the stubs for entry point(s) you do not need and add any other entry points you may need.
  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.