Overview
A script is a sequence of statements in a small C-like language. It has variables,
if/else, a for loop, arithmetic, comparison, logical and bitwise operators, and calls to
builtins: the functions the engine provides, such as WindowMaximize or
KeyboardPressKeyCombo. You cannot define your own functions, and there are no arrays or objects.
Every value is a single scalar.
An action's script is written for one of two engines, and both compile to the same bytecode:
- Script: the text language this reference documents.
- Steps: a TOML list of steps, used by the config UI's step editor and by recorded macros. See The Steps engine.
A script is compiled before it runs. A syntax error, an unknown builtin or a wrong argument count stops it from running at all, and you get one error with its line and column. After compiling, it runs top to bottom on a thread of its own.
Try things in the diagnostic console. Open it with the tray menu's Show Console item. The
console's Script tab runs a script right away, sends UtilityPrint output to that tab, and
completes builtin names as you type. Every example in this reference can be pasted into it.