This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
Scripting_the_Keyboard_Maestro_editor [2017/09/20 16:29] JMichaelTX ADD example to get current macro |
Scripting_the_Keyboard_Maestro_editor [2017/09/20 16:41] JMichaelTX [1. Get Current Macro Object] Revise script |
||
---|---|---|---|
Line 10: | Line 10: | ||
tell application "Keyboard Maestro" | tell application "Keyboard Maestro" | ||
+ | # Ver 1.1 2017-09-20 | ||
+ | | ||
+ | set macroList to every macro whose selected is true | ||
+ | | ||
+ | --- Make Sure Only ONE Macro is Selected --- | ||
+ | | ||
+ | if ((count of macroList) = 1) then | ||
+ | set oMacro to first macro whose selected is true | ||
+ | else | ||
+ | error "Multiple Macros are selected. Select only ONE and re-execute this script." | ||
+ | end if | ||
+ | | ||
+ | --- Now We can Get/Set Macro Properties --- | ||
| | ||
- | set oMacro to first macro whose selected is true | ||
set macroName to name of oMacro | set macroName to name of oMacro | ||
| | ||
Line 18: | Line 30: | ||
end tell | end tell | ||
``` | ``` | ||
+ | |||
===== 2. Get and Create Variety of Editor Objects ===== | ===== 2. Get and Create Variety of Editor Objects ===== |