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 [2017/12/15 02:54] – ADD script to get class of object selected JMichaelTX | Scripting_the_Keyboard_Maestro_editor [2018/04/14 23:02] (current) – Removed script from Section 4 because it won't even compile. JMichaelTX | ||
|---|---|---|---|
| Line 9: | Line 9: | ||
| ===== 1. Selecting Lists of Objects in KM8 ===== | ===== 1. Selecting Lists of Objects in KM8 ===== | ||
| - | The `selection` property will return whatever is selected, and has focus, in the Keyboard Maestro | + | The `selection` property will return whatever is selected, and has focus, in the Keyboard Maestro |
| ```applescript | ```applescript | ||
| 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 " | ||
| - | | + | ===== 5. Create Macro Group and Macros ===== |
| - | | + | |
| - | make new smart group with properties {name:" | + | Before you use a macro group you probably want to check if it exists. The following example tests for the macro group's existence, based on a Keyboard Maestro input variable containing the macro group name -`macroGroup`. |
| - | set search strings of smart group " | + | |
| - | + | ||
| - | set enable of macro group "Turn Off" to false | + | |
| - | set name of macro 1 to "Great!" | + | (This test is case-insensitive. For example |
| - | tell macro group "New Stuff" | + | ```applescript |
| - | + | tell application | |
| - | set color of action 1 of macro " | + | set macroGroup |
| - | + | if (macroGroup = "" | |
| - | | + | end tell |
| - | set selection to global macro group | + | tell application |
| - | + | if exists | |
| - | move first action of macro "Source Macro" to end of actions of macro "Dest Macro" | + | |
| - | + | else | |
| - | move macro " | + | |
| - | move (every macro of macro group " | + | |
| - | move macro 2 of macro group " | + | |
| - | + | ||
| - | | + | |
| - | | + | |
| - | | + | |
| - | + | ||
| - | set m to duplicate action 1 of macro " | + | |
| - | + | ||
| - | | + | |
| - | + | ||
| end tell | end tell | ||
| ``` | ``` | ||
| - | ===== 5. Create Macro Group and Macros ===== | ||
| 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.1513306466.txt.gz · Last modified: by JMichaelTX
