Support for third-party application

Switch offers special support for scripted plug-ins that control a third-party application. The reason is that information about the third-party application's location and licensing should be managed centrally. Rather than offering a property for each instance of the script in a flow, the scripted plug-in's icon in the Elements pane offers a context menu item to set the property value once and for all.

Moreover some scripted plug-ins can automatically discover the third-party application's location and this should happen only once since it may be a time-consuming process.

Special properties

If a script package is loaded as a scripted plug-in, Switch treats the property tags "ApplicationPath" and "ApplicationLicense" in a special way:


If the script package is not loaded as a scripted plug-in, these properties are not treated in any special way.

Special entry points

If a script package is loaded as a scripted plug-in, the optional findApplicationPath, licenseApplication, and getApplicationLicensing entry points help manage the special properties discussed above in conjunction with the context menu items.

If the findApplicationPath entry point is present, this means that the scripted plug-in controls an external application. If the entry point returns a non-empty string, this value is used as the application path stored in the central "ApplicationPath" property. Otherwise the application path remains empty, the scripted plug-in's icon in the Elements pane is grayed out and a context menu item is offered to set (or view) the application path manually.

The findApplicationPath entry point can return "/:External resource:/" if there is no application path available, for example if it is on a network server.

The findApplicationPath entry point can use the findRegisteredApplication() and findApplicationOnDisk() functions offered by the Environment class to help discover the third-party application.

If the licenseApplication entry point is present, this means that the application can be licensed through Switch. In this case the scripted plug-in's icon in the Elements pane offers a context menu item that displays a dialog requesting a license key. When the user enters a license key and closes the dialog box, the licenseApplication entry point is called and the license key is stored in the central "ApplicationLicense" property. This allows the script to perform licensing once (in the entry point, when the key is entered) or pass the license key with every execution (by retrieving the property value).

The getApplicationLicensing entry point serves to provide feedback about the third-party application licensing state through a context menu on the scripted plug-in's icon in the Elements pane.

Testing special properties and entry points

SwitchScripter does not emulate central management of these special properties and entry points. However it does allow testing the special entry points just like any other entry points, and it treats the properties as regular properties (so you can enter a value in the Fixture pane). Thus SwitchScripter fully supports developing and testing these special features; see Testing a script.