To create a new script package for Switch from a blank sheet:
Launch SwitchScripter or, if it is already running, press the
"Create new" tool button.
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.
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).
Use the Declaration pane to further configure the script
declaration, including supported connections and injected properties.
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.
Press the "Save" tool button to save your script package with an
appropriate name in a location of your choice.
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.