token:Variable
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| token:Variable [2016/02/11 08:21] – A few minor edits JMichaelTX | token:Variable [2023/09/13 03:50] (current) – peternlewis | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | {{: | + | ===== Variable Token ===== |
| - | ====== Keyboard Maestro Variables ====== | + | |
| - | Keyboard Maestro variables are used much like variables in any scripting or macro language. | + | The // |
| - | + | ||
| - | + | ||
| - | However, they have one key difference from most other languages: | + | |
| - | + | ||
| - | + | ||
| - | Instead of software code, Keyboard Maestro variables are set by [[: | + | |
| - | + | ||
| - | It should be noted that **all Keyboard Maestro variables are text**. | + | |
| - | + | ||
| - | ===== Setting Variables ===== | + | |
| - | + | ||
| - | The most common Action to set a variable is, well, [[action: | + | |
| - | + | ||
| - | {{ : | + | |
| - | + | ||
| - | There are a number of other [[: | + | |
| - | * [[action: | + | |
| - | * [[action: | + | |
| - | * [[action: | + | |
| - | * [[action: | + | |
| - | + | ||
| - | In addition to these, there are a number of more complex Actions that can also set a variable. | + | |
| - | + | ||
| - | ===== Using Variables ===== | + | |
| - | + | ||
| - | There are many Macro Actions that can use variables. | + | |
| - | + | ||
| - | ==== Variable Tokens ==== | + | |
| - | + | ||
| - | The // | + | |
| - | where `< | + | |
| For Example, using the [[action: | For Example, using the [[action: | ||
| {{ : | {{ : | ||
| + | |||
| + | You can (v7.2+) access a variable as if it is a comma separated array of text using the notation // | ||
| You can also use a short form of just //%Variable Name%// to include variables as long as the variable exists and has a value and there is no corresponding text token, although generally it is better and clearer to use the longer form // | You can also use a short form of just //%Variable Name%// to include variables as long as the variable exists and has a value and there is no corresponding text token, although generally it is better and clearer to use the longer form // | ||
| + | ===== See Also ===== | ||
| - | + | - [[:Text Fields]] | |
| - | ==== Variable Arrays ==== | + | - [[:Tokens]] |
| - | + | - [[manual:Variables]] | |
| - | Variables can contain an array of comma separated **numbers**, | + | |
| - | + | ||
| - | **It is important to note that variable arrays can contain only numeric values**. | + | |
| - | + | ||
| - | For example, suppose the variable `MyArray` has this value: | + | |
| - | In any Keyboard Maestro Action where you would like to use the array element `%Calculate%MyArray[2]`, | + | |
| - | + | ||
| - | ===== Using Variables in Scripts ===== | + | |
| - | + | ||
| - | You can get and set Keyboard Maestro Variables in these types of scripts: | + | |
| - | * [[:AppleScript|AppleScript]] | + | |
| - | | + | |
| - | * [[: | + | |
| - | + | ||
| - | Click on the above links for example scripts. | + | |
token/Variable.1455178906.txt.gz · Last modified: by JMichaelTX
