documentation:Variables
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| documentation:Variables [2016/05/30 08:45] – peternlewis | documentation:Variables [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Variables ====== | ||
| - | |||
| - | Keyboard Maestro includes permanently stored variables that you can use or set in many 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. | ||
| - | |||
| - | 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 directly by shell scripts or AppleScripts, | ||
| - | |||
| - | Variable values are text, but they can contain comma separated numbers, and can then be accessed as arrays (eg Variable~~Name[1]). | ||
| - | |||
| - | Variables values can be accessed from shell scripts or JavaScript for Applications 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 CODE{{{%Delete%}}} to avoid having it show up in variable popup menus. | ||
| - | |||
| - | There are various variables used by Keyboard Maestro to convey information, | ||
| - | |||
| - | | 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 CODE{{{%TriggerValue%}}} token | | ||
| - | | Mouse Click Result | replaced by the CODE{{{%ActionResult%}}} token | | ||
| - | | Press Button Result | replaced by the CODE{{{%ActionResult%}}} token | | ||
| - | | Select Menu Result | replaced by the CODE{{{%ActionResult%}}} token | | ||
| - | | USB Device Name | replaced by the CODE{{{%TriggerValue%}}} token | | ||
| - | |||
| - | You can add a variable to an action using the [[Menus# | ||
| - | |||
| - | Variables are created on demand, but you can add, delete, see or change variables in the [[Windows# | ||
documentation/Variables.1464597905.txt.gz · Last modified: by peternlewis
