Scripting_the_Keyboard_Maestro_editor
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| Scripting_the_Keyboard_Maestro_editor [2018/04/14 14:42] – Added snippet to test for existence of a macro group MartinPacker | Scripting_the_Keyboard_Maestro_editor [2018/04/14 23:02] (current) – Removed script from Section 4 because it won't even compile. JMichaelTX | ||
|---|---|---|---|
| Line 91: | Line 91: | ||
| ===== 4. Get and Create Variety of Editor Objects ===== | ===== 4. Get and Create Variety of Editor Objects ===== | ||
| + | FIXME [JMichaelTX: | ||
| - | ```applescript | ||
| - | tell app " | ||
| - | |||
| - | | ||
| - | | ||
| - | |||
| - | make new smart group with properties {name:" | ||
| - | set search strings of smart group " | ||
| - | |||
| - | set enable of macro group "Turn Off" to false | ||
| - | |||
| - | set name of macro 1 to " | ||
| - | |||
| - | tell macro group "New Stuff" to make new macro | ||
| - | | ||
| - | set color of action 1 of macro " | ||
| - | |||
| - | | ||
| - | |||
| - | set selection to global macro group | ||
| - | |||
| - | move first action of macro " | ||
| - | |||
| - | move macro " | ||
| - | move (every macro of macro group " | ||
| - | move macro 2 of macro group " | ||
| - | |||
| - | | ||
| - | | ||
| - | | ||
| - | |||
| - | set m to duplicate action 1 of macro " | ||
| - | |||
| - | | ||
| - | |||
| - | end tell | ||
| - | ``` | ||
| ===== 5. Create Macro Group and Macros ===== | ===== 5. Create Macro Group and Macros ===== | ||
| Line 134: | Line 98: | ||
| Before you use a macro group you probably want to check if it exists. The following example tests for the macro group' | Before you use a macro group you probably want to check if it exists. The following example tests for the macro group' | ||
| - | (This test is case-insensitive. For example | + | (This test is case-insensitive. For example |
| ```applescript | ```applescript | ||
| tell application " | tell application " | ||
| - | set macroGroup to getvariable " | + | |
| + | if (macroGroup = "" | ||
| end tell | end tell | ||
| - | tell application | + | tell application "Keyboard Maestro" |
| - | if exists macro group macroGroup then | + | if exists macro group macroGroup then |
| - | return true | + | return true |
| - | else | + | else |
| - | return false | + | return false |
| - | end if | + | end if |
| end tell | end tell | ||
| + | ``` | ||
| - | ``` | ||
| Here is a full example that creates a macro group called " | Here is a full example that creates a macro group called " | ||
Scripting_the_Keyboard_Maestro_editor.1523716961.txt.gz · Last modified: by MartinPacker
