Skip to main content

Run code in session

Run code, or a file, in an open script session; the value of a last expression (Python, JavaScript) or of the code (VBScript Eval, when run_as is eval) comes back (G4).

Command in the Scripts toolkit · id ooa.script/run_in_session · 6 inputs, 3 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
SessionStringNoscriptName of the script session, from Open script session.
ScriptStringNoCode to run.
FileFileNoOr a script file to run in the session.
Timeout (seconds)NumberNo300Maximum run time; the session is closed when it runs out.
Fail on errorBooleanNotrueStop the step when the code raises an error.
Run asStringNoexecVBScript only: exec runs statements; eval works out an expression and returns its value.

Outputs​

OutputTypeWhat it is
resultAnyThe value of the last expression, when there is one.
outputStringText the code printed.
errorStringThe error when fail_on_error is off; empty on success.