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
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Session | String | No | script | Name of the script session, from Open script session. |
| Script | String | No | Code to run. | |
| File | File | No | Or a script file to run in the session. | |
| Timeout (seconds) | Number | No | 300 | Maximum run time; the session is closed when it runs out. |
| Fail on error | Boolean | No | true | Stop the step when the code raises an error. |
| Run as | String | No | exec | VBScript only: exec runs statements; eval works out an expression and returns its value. |
Outputs
| Output | Type | What it is |
|---|---|---|
| result | Any | The value of the last expression, when there is one. |
| output | String | Text the code printed. |
| error | String | The error when fail_on_error is off; empty on success. |