This information is for Vicon Shogun 1.7. For up-to-date help, see the latest Shogun documentation.

Vicon Shogun banner


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.

Functional area


Command syntax


runScript "script"[-file] [-noFail]


scriptstringyesEither 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 Post HSL scripting use forward slashes instead of back-slashes.


NameFlag argumentsArgument typeExclusive toComments
file0Specifies that the "script" is a file path rather than a script snippet.
noFail0Specifies 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".

Return value


If the -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";
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