Automating the Keyboard Maestro Editor with AppleScript

Hey Folks,

Toggle the enabled/disabled state of the selected macro(s) – no matter what is selected in the Keyboard Maestro editor.

Run from an Execute an AppleScript action.

--------------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2016/12/20 08:00
# dMod: 2016/12/20 08:08
# Appl: System Events & Keyboard Maestro Editor
# Task: Toggle the Enabled-Disabled state of the selected macros.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @System_Events, @Keyboard_Maestro, @Toggle, @Enabled, @Disabled, @State, @Selected, @Macros
# Note: Likely to fail on non-English language systems due to localization issues.
--------------------------------------------------------------------------------

tell application "System Events"
   tell application process "Keyboard Maestro"
      tell (first window whose subrole is "AXStandardWindow")
         tell (first button whose accessibility description is "Enable or Disable Macro")
            perform action "AXPress"
         end tell
      end tell
   end tell
end tell

--------------------------------------------------------------------------------

-Chris

4 Likes