/
scriptExists
scriptExists
Description
This command enables you to query Shogun Post's internal list of scripts to see whether a particular script exists. This may be useful if you are trying to construct a set of smart scripts which call other scripts based on their existence.
Calling a script which does not exist will cause the calling script to fail, which is almost always undesirable.
This command is largely superseded by the runScript command.
Functional area
System
Command syntax
Syntax
scriptExists "scriptName" |
Arguments
Name | Type | Required | Comments |
---|---|---|---|
scriptName | string | yes | Name of the script to look for. The script name is the portion of the script file's file name excluding the extension (e.g. CutKeysSmart.hsl would have a name of CutKeysSmart). |
Flags
None
Return value
boolean
Returns true if a script with the given name exists in Shogun Post's internal list of scripts.
Examples
// See if the CutKeysBigRanges script exists in our script directories. //If not don't call the script that relies on it. if( `scriptExists "CutKeysBigRanges` == true ) { ScriptThatCallsCutKeysBigRanges; }
Additional information
Related commands
, multiple selections available,