This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
AppleScript [2017/09/04 02:07] peternlewis |
AppleScript [2017/10/04 02:52] peternlewis [Examples] |
||
---|---|---|---|
Line 67: | Line 67: | ||
``` | ``` | ||
+ | To get or set local or instance variables, you must pass the macro execution instance to the `getvariable` or `setvariable` command. The instance is passed in to your script via the KMINSTANCE environment variable (v8.0.3+). | ||
+ | |||
+ | ```applescript | ||
+ | set inst to system attribute "KMINSTANCE" | ||
+ | tell application "Keyboard Maestro Engine" | ||
+ | set v to getvariable "LocalVar" instance inst | ||
+ | setvariable "LocalOut" instance inst to "FromAS" | ||
+ | end tell | ||
+ | v | ||
+ | ``` | ||
**For more details, see [[manual:Scripting|Scripting article in the Manual Section]].** | **For more details, see [[manual:Scripting|Scripting article in the Manual Section]].** | ||
- | |||
- | ---- | ||
- | |||
===== Get and Set Dictionary Values ===== | ===== Get and Set Dictionary Values ===== | ||