...
Runs a script snippet or script file.
In Shogun 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.
...
Name | Type | Required | Comments |
---|---|---|---|
script | string | yes | Either a small script snippet (e.g. print "Hello"; or a full path to a script file to execute.Note that all file paths in Shogun inShogun Post HSL scripting use forward slashes instead of back-slashes. |
...
Scroll tablelayout | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
If the -noFail
flag is specified, returns whether the script successfully ran. Otherwise always returns true.
Examples
Code Block | ||
---|---|---|
| ||
// Execute a small script which just prints "Hello World" to the |
...
// command log. |
...
string $str = "Hello World"; |
...
runScript $str; |
...
...
// 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`; |
...
print $wasSuccessful; |
Additional information
Related commands
...