Application discovery and licensing

The optional entry points described in this section provide support for scripted plug-ins that serve as a configurator for a third-party application. If the script is not loaded as a scripted plug-in these entry points are never invoked. See also creating a scripted plug-in, configurator guidelines and detecting third-party applications.

findApplicationPath( e : Environment, startup : Boolean ) : String

Is invoked for a scripted plug-in to discover the associated third-party application – if any.

Returns the absolute file path for the third-party application's executable (".exe" on Windows, ".app" on Mac). If the entry point returns null or the empty string, this means that the script cannot discover the application and that the user will need to set the application path.

The startup argument is true when this entry point is invoked during Switch startup, and false when invoked as a result of a user action (that is, not during startup). When startup is true, the entry point should not perform time-consuming operations. The Environment.findApplicationOnDisk() function is automatically disabled (it returns an empty string without searching) so it is safe to call this function without explicitly checking for startup.

If this entry point is absent, Switch offers no user interface for setting an application path for this scripted plug-in; otherwise it does (even if the script can determine the application path).

getApplicationLicensing( e : Environment ) : String

Is invoked for a scripted plug-in to discover the licensing state of the associated third-party application. Returns one of the following strings to indicate the licensing state: "Licensed", "Demo", "Trial", "Unlicensed", "Unknown". The Switch designer displays a localized version of these strings.

If this entry point is absent, this means the licensing state is irrelevant or cannot be discovered even in principle. This not the same thing as returning "Unknown", which means there is a mechanism for discovering the licensing state but it failed this time to produce a conclusive result.

licenseApplication( e : Environment, license : String )

Is invoked when the user enters or modifies the license key for the scripted plug-in in the designer. Attempts to license the associated third-party application with the specified string.

If this entry point is absent, Switch offers no user interface for entering a license key for this scripted plug-in.