Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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.

...

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

...

Scroll tablelayout
style
sortDirectionASC
repeatTableHeadersdefault
widths11%, 15%, 14%, 13%, 47%
style
sortByColumn1
sortEnabledfalse
cellHighlightingtrue

...

If the -noFail flag is specified, returns whether the script successfully ran. Otherwise always returns true.

Examples

Code Block
languagetext
// 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

...