AppleScript
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| AppleScript [2019/03/28 18:41] – ADD tell block to first example. JMichaelTX | AppleScript [2025/02/27 06:45] (current) – [Local & Instance Variables] peternlewis | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| Keyboard Maestro Version 7.1 introduced a streamlined way to Get and Set Keyboard Maestro Variables from AppleScript. | Keyboard Maestro Version 7.1 introduced a streamlined way to Get and Set Keyboard Maestro Variables from AppleScript. | ||
| - | In AppleScript, | + | In AppleScript, |
| ```applescript | ```applescript | ||
| tell application " | tell application " | ||
| - | getvariable <KM Variable Name> | + | |
| - | setvariable <KM Variable Name> to <New Value> | + | setvariable |
| end tell | end tell | ||
| ``` | ``` | ||
| Line 80: | Line 80: | ||
| - | To get or set [[manual: | + | To get or set [[manual: |
| - | + | ||
| - | * //Local Variables// are denoted by a Variable with the prefix of " | + | |
| - | * //Instance Variables// are denoted by a Variable with the prefix of " | + | |
| ```applescript | ```applescript | ||
| - | ### Requires Keyboard Maestro 8.0.3+ ### | ||
| - | |||
| set kmInst to system attribute " | set kmInst to system attribute " | ||
| tell application " | tell application " | ||
| - | set kmLocalVar1 | + | set v to getvariable " |
| setvariable " | setvariable " | ||
| end tell | end tell | ||
| - | log kmLocalVar1 | + | log v |
| ``` | ``` | ||
AppleScript.1553798491.txt.gz · Last modified: by JMichaelTX
