---
title: "OSExec"
---
Executes an OtterScript string.
OSExec(
ScriptText: <text>,
[Variables: <%(key1: value1, ...)>],
[OutputVariables: <@(text)>]
);
This operation may be prefixed with Core::
, although this is a built-in namespace and isn't really necessary.
Name | Format | Script Usage | Usage Notes |
---|---|---|---|
☆ Script text (default) | text | ScriptText | This argument is required. |
Variables | %(key1: value1, ...) | Variables | Specify parameters to pass in to the script using a map. For example: %(param1: $SomeVariable, param2: @(list,of,items)) |
Output variables | @(text) | OutputVariables | Specify variables to capture and set in the calling scope using a list. For example: @(filePath,errorMessage) |
Note: Runtime variables you've defined before executing an Invoke operation will not be visible to the invoked script, and variables that you set within the invoked script will not be available.