Keyboard Maestro 6 IconKeyboard Maestro 6

Conduct your Mac Like a Pro!

Variables

Keyboard Maestro includes permanently stored variables that you can use in a number of special purpose actions, as well as in Calculations or Text Tokens which can be used in almost any field in Keyboard Maestro.

Variable names must start with a letter, and then can contain letters, numbers, spaces, or underscores. Variable names are case insensitive, but their case is remembered.

Variables with names that start or end with “Password” or “PW” are considered passwords – their values will not be stored (except in memory) and they cannot be read by shell scripts or AppleScripts. The Prompt For User Input dialog will display such variables in a password field.

Variable values are text, but they can contain comma separated numbers, and can then be accessed as arrays (eg Variable Name[1]). Mouse positions, window frames and the like can then be stored and manipulated in variables.

Variables values can be accessed from shell scripts via environment variables, and from AppleScript via environment variables or using AppleScript commands to the Keyboard Maestro Engine, and from JavaScript using the document.kmvar dictionary, see the Scripting section.

You can also set a variable value to %Delete% to avoid having it show up in variable popup menus.

There are various variables used by Keyboard Maestro to convey information, including:

Alert Button
the name of the button clicked in an alert.
Result Button
the name of the button clicked in a Prompt For User Input dialog.

Note that these variables can easily be overwritten by other actions, so you need to use caution when depending on them.

The following special variables were:

Mounted Volume Name
replaced by the %TriggerValue% token.
Mouse Click Result
replaced by the %ActionResult% token.
Press Button Result
replaced by the %ActionResult% token.
Select Menu Result
replaced by the %ActionResult% token.
USB Device Name
replaced by the %TriggerValue% token.

You can add, delete, see or change variables in the Variables preference pane.

Continue on to Filters

Close

Feedback Form

Please provide any feedback you may have


Email Address:
Subject:
Feedback:


Your email address is appreciated but is not required and will not be saved.
It will be used only for responding to or clarifying this feedback.

Documentation

Old Documentation