Runs a script snippet or script file.
In Shogun Post, you normally have one script execute another script just by providing the script name of one of the script files in your script directories. However, sometimes you want to construct a script "on the fly" by composing a string that contains the script contents. This command allows you to execute the contents of a string. It also allows you to execute a script file which may not exist within your script directories.
|string||yes||Either a small script snippet (e.g. |
Note that all file paths in Shogun Post HSL scripting use forward slashes instead of back-slashes.
|Name||Flag arguments||Argument type||Exclusive to||Comments|
|0||—||—||Specifies that the "script" is a file path rather than a script snippet.|
|0||—||—||Specifies that this command (causing the script which calls it to fail) if the execution of "script" fails. The command will then return true or false depending on the successful completion of "script".|
-noFail flag is specified, returns whether the script successfully ran. Otherwise always returns true.
// Execute a small script which just prints "Hello World" to the
// command log.
string $str = "Hello World";
// Alternatively run a script that is in your temp folder
// and find out whether it ran successfully.
boolean $wasSuccessful = `runScript "C:/Temp/MyScript.hsl" -file -noFail`;