User Tools

Site Tools


Scripting_the_Keyboard_Maestro_editor

**This is an old revision of the document!**

Scripting the Keyboard Maestro editor

As of v8.0, the Keyboard Maestro editor is fully OSA (Open Scripting Architecture) compatible. This means you can edit your Keyboard Maestro macros from AppleScript in a variety of powerful ways.

The Keyboard Maestro Scripting Definition (sdef) describes all the support, and you can open in in the Script Editor to see more details. Here are some examples of what you can do:

AppleScript tell app "Keyboard Maestro" properties of group "Enabled" properties of smart group "Enabled" make new smart group with properties {name:"Enabled", search strings:{"enabled:yes"}} set search strings of smart group "Disabled" to {"enabled:no"} set enable of macro group "Turn Off" to false set name of macro 1 to "Great!" tell macro group "New Stuff" to make new macro set color of action 1 of macro "Bright" to "red" select action 1 through 3 of action 2 of macro "Working" set selection to global macro group move first action of macro "Source Macro" to end of actions of macro "Dest Macro" delete second action of macro "Target Macro" duplicate every macro group whose name starts with "Test" set m to duplicate action 1 of macro "Macro33" to after action 2 of macro "Macro32" duplicate (selected macros) to macro group "Test4" end tell

Scripting_the_Keyboard_Maestro_editor.1504165588.txt.gz · Last modified: 2017/08/31 03:46 by peternlewis