Step parameters
When you select a step, its fields open under it, one per detail the step needs. Each field is labelled in plain words. Point at a field to see a tooltip saying what it is for.
Kinds of field
| Field | Looks like | Accepts |
|---|---|---|
| Text | a text box | any text |
| Whole number | a text box | a whole number, such as 250 or -3, a hexadecimal number starting with 0x, such as 0xB3, or a named constant, such as VirtualKey.MediaPlayPause |
| Number | a text box | a number with a period as the decimal point, such as 0.5, whatever your regional format |
| True or false | a switch | on (true) or off (false) |
| A choice of named values | a drop-down ② | one of the listed names, such as MouseButton.Primary; you can also type in it |
| Window | a text box | a window from the value menu or from a variable, normally Target window |
| Keys (Send keys) | a key capture box | the key combination you press |
In every kind of field you can also type $ and a variable's name to use a value an earlier step
saved (Variables).
A number in a step's field always uses a period as the decimal point and no thousands separators, whatever your regional format.
Named constants
A Whole number or Number field also takes a named constant: a namespace, a dot and a name, such as
VirtualKey.MediaPlayPause or AudioEndpoint.Playback, the same names a script uses (Named
constants). Type it exactly, with the same capitals and no spaces. The
step saves the name and the action uses its number when it runs. A Text field keeps such a name as
the text you typed.
The Keys field
Send keys has a capture box instead of a text box. Click it (Click to set a shortcut), then
press the combination. Only the combination is recorded; nothing is sent while you set it. Keys that
a key combination can't name, such as media keys, are refused with a message. To press those, use
the Press and release key step (KeyboardPressKey) with the key's name, such as
VirtualKey.MediaPlayPause (Worked recipes).
New steps start filled in
A new step's Window fields start as Target window: the window the gesture was drawn over, or the window with the focus for a hotkey or typed text. Its switches start off. Every other field starts empty, for you to fill in.
Choosing a value from the menu
Every field except Keys and the switches has a small arrow at its end (Choose a value). It opens a menu of values that fit the field ①. Besides a step's own fields, the menu is on a condition's Value and Compared with fields and its single Value (Conditions), a repeat's Times (Repeating steps) and a Set variable step's Value (Variables).
| Section | Values |
|---|---|
| From what started the action | Target window, Target control, Gesture name, Action name, App group name, Gesture button, and the gesture's Gesture left edge, Gesture top edge, Gesture width and Gesture height |
| Read when the step runs | Active window, Mouse X position, Mouse Y position, Clipboard text, Current date and time |
| Saved by earlier steps | the variables that steps above this one save |
The menu lists only values of the field's kind: a Number field also takes whole numbers, and a field that accepts anything takes them all. Times offers only whole numbers; a condition's fields and a Set variable value offer every reading. When nothing fits, the menu says Nothing to choose for this field.
A chosen value shows as a chip with its name in place of the text box. Point at the chip to see what it is and how a script writes it. Its Clear button empties the field so you can type again.
The values under From what started the action read the trigger: for an action started by a hotkey or typed text, the gesture values are empty or 0. Every value is offered wherever steps run, because a snippet can be called from anywhere.
On a switch, a variable you typed earlier shows as a chip; clearing the chip turns the switch off.
Checks as you type
Each field is checked as you type. A problem shows in red under the field and the field's border turns red:
| Message | Meaning |
|---|---|
| This value is required. | A Set variable step's variable name is empty. |
| Enter a whole number (decimal or 0x hex), a named constant, or a $variable. | A Whole number field holds something else. |
| There's no named constant with this name. Check the spelling and capitals, as in VirtualKey.MediaPlayPause. | A Whole number or Number field holds a namespace, a dot and a name that isn't a named constant. |
| Enter a number, or a $variable. | A Number field holds something else. |
| Enter true or false, or a $variable. | A true-or-false field typed as text holds something else. |
| A step can't run a builtin inside an argument. Move it into a variable first. | The field holds a builtin call with something in its parentheses (below). |
While a field holds typed text that fails its check, such as letters in a Whole number or Number
field, a name that isn't a named constant, or anything but true or false in a true-or-false
field, the steps aren't saved: the action keeps its last saved steps, and Steps not saved: step N
has a field that isn't valid shows under the list until you fix the field
(Problems).
An empty field shows no message and never blocks saving; the steps are saved with the field empty. When the action runs, a step with an empty number, true-or-false or window field stops the action there, and the console's System output says that argument has the wrong type. An empty Text field runs as empty text, which for some builtins (a file name, a window title to find) means the step does nothing.
Move into a variable
A field holds a value, a variable, or one of the readings in the value menu, never a builtin call
with arguments. If you type one, such as WindowGetTitle($w), the field offers Move into a
variable. It adds a step just above this one that runs the call and saves the result under a name
taken from the field (such as window, then window2), and puts that variable in the field.
A call with nothing in its parentheses, such as ClipboardGetText(), is fine: it is the same as
choosing that reading from the value menu. That holds in every field that has the value menu,
a condition's fields, Times and a Set variable value included.
Keeping a step's result
Most builtins give a result: the text they read, the window they found, or whether they worked.
Save result as ③ keeps it under a name, so later steps can use it as $name. Leave it empty to
ignore the result.
A step that keeps its result shows "→ $name" at the end of its summary. Names follow the rules in Variables.
Wrong kinds at run time
The editor checks the shape of what you type, not every rule of the builtin. When the action runs, a value of the wrong kind (for example a variable holding text where a builtin needs a whole number) or a value the builtin refuses stops the action with an error in the diagnostic console. See Errors.