Automating the Keyboard Maestro Editor with AppleScript

Hey Folks,

Peter spent a lot of effort making Keyboard Maestro 8 more AppleScriptable. (Thank you Peter!)

And this makes many things easy to do that were difficult or impossible in previous versions of KM.


When I’m testing something in Keyboard Maestro or creating a new macro I almost always use (or at least start out with) the same test macro:

Generic-Test 01

Therefore I want to get to that macro quickly quite often.

Using the following script I can manage that spectacular feat with a keystroke.

The user is REQUIRED to provide names for their test-group and test-macro — see User Settings in the script.

If the designated group or the macro don’t exist they will be created as necessary.

------------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2014/08/21 21:37
# dMod: 2017/11/17 04:46
# Appl: Keyboard Maestro
# Task: Edit 'Generic Test 1' Macro of macro group 'Test Group'.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Keyboard_Maestro_8, @KM8, @Editor, @Edit, @Macro
------------------------------------------------------------------------------

try
   
   ---------------------------------------------------------------------------
   # User Settings:
   ---------------------------------------------------------------------------
   set macroGroupName to "Test Group"
   set macroName to "Generic-Test 01"
   ---------------------------------------------------------------------------
   
   tell application "Keyboard Maestro"
      
      ------------------------------------------------------------------------
      # Make sure the designated macro group and macro exist.
      # Create one or both of them as necessary.
      ------------------------------------------------------------------------
      
      if (exists of macro group macroGroupName) = false then
         set newGroup to make new macro group with properties {name:macroGroupName}
         select newGroup
      end if
      
      if (exists of macro macroName) = false then
         tell macro group macroGroupName
            set newMacro to make new macro with properties {name:macroName}
            select newMacro
            return --» script ends here IF a new macro is created.
         end tell
      end if
      
      ------------------------------------------------------------------------
      # Select the macro group if necessary.
      ------------------------------------------------------------------------
      
      if selected of macro group macroGroupName = false or length of (get selected macro groups) > 1 then
         select macro group macroGroupName
      end if
      
      ------------------------------------------------------------------------
      # Select the macro for editing.
      ------------------------------------------------------------------------
      
      editMacro macroName
      
      ------------------------------------------------------------------------
      
   end tell
   
on error e number n
   set e to e & return & return & "Num: " & n
   if n ≠ -128 then
      try
         tell application (path to frontmost application as text) to set ddButton to button returned of ¬
            (display dialog e with title "ERROR!" buttons {"Copy Error Message", "Cancel", "OK"} ¬
               default button "OK" giving up after 30)
         if ddButton = "Copy Error Message" then set the clipboard to e
      end try
   end if
end try

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

Enjoy.

-Chris

3 Likes

Hey Folks,

When I write a macro for someone else and sometimes when I’ve accomplished a difficult bit of testing, I often want to save the final result in my “e_Examples” macro group.

It’s named that way, so it sorts a the top of the groups starting with “e”. That way I can hit one keystroke to move the focus in the editor to the group pane and then “e” to get to that group.

I used to have to copy my new creation and then go through the above rigamarole to get to the examples group and then paste.

Now with Keyboard Maestro 8 I can move the selected macros with an AppleScript and one keystroke.

------------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2017/11/17 05:58
# dMod: 2017/11/17 06:04
# Appl: Keyboard Maestro
# Task: Move the Selected Macros to a user-designated macro group.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Keyboard_Maestro_8, @KM8, @Move, @Selected, @Macros, @Designated, @Group
------------------------------------------------------------------------------

try
   
   ---------------------------------------------------------------------------
   # User settings:
   ---------------------------------------------------------------------------
   set moveToGroupName to "e_Examples"
   ---------------------------------------------------------------------------
   
   tell application "Keyboard Maestro"
      
      set macroSelectionList to selected macros
      
      if macroSelectionList = {} then
         error "No macros are selected!"
      end if
      
      # Disable any macros that are enabled.
      repeat with theMacro in macroSelectionList
         if enabled of theMacro is true then
            set enabled of theMacro to false
         end if
      end repeat
      
      move macroSelectionList to macro group moveToGroupName
      
   end tell
   
on error e number n
   set e to e & return & return & "Num: " & n
   if n ≠ -128 then
      try
         tell application (path to frontmost application as text) to set ddButton to button returned of ¬
            (display dialog e with title "ERROR!" buttons {"Copy Error Message", "Cancel", "OK"} ¬
               default button "OK" giving up after 30)
         if ddButton = "Copy Error Message" then set the clipboard to e
      end try
   end if
end try

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

Enjoy.

-Chris

2 Likes

Hey Folks,

Since I’ve made it easier to file things in my e_Examples group, I thought I’d make it easier to access it for searching.

This AppleScript will take you straight to the designated group name in the Keyboard Maestro editor.

------------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2017/11/17 01:09
# dMod: 2017/11/17 01:19
# Appl: Keyboard Maestro
# Task: Select the macro group "e_Examples".
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @KM8, @Keyboard_Maestro_8, @Keyboard_Maestro_Editor, @Select, @Macro, @Group, @e_Examples
------------------------------------------------------------------------------

try
   
   ---------------------------------------------------------------------------
   # User Settings:
   ---------------------------------------------------------------------------
   set macroGroupName to "e_Examples"
   ---------------------------------------------------------------------------
   
   tell application "Keyboard Maestro"
      
      if macro group macroGroupName exists then
         select macro group macroGroupName
      else
         error "Cannot select macro group " & macroGroupName & " — it is missing!"
      end if
      
   end tell
   
on error e number n
   set e to e & return & return & "Num: " & n
   if n ≠ -128 then
      try
         tell application (path to frontmost application as text) to set ddButton to button returned of ¬
            (display dialog e with title "ERROR!" buttons {"Copy Error Message", "Cancel", "OK"} ¬
               default button "OK" giving up after 30)
         if ddButton = "Copy Error Message" then set the clipboard to e
      end try
   end if
end try

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

Enjoy.

-Chris

1 Like

I think this macro goes well with your other macro that brings focus to the Macros section of the group :

--------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2015/07/25 03:06
# dMod: 2015/07/25 03:14
# Appl: Keyboard Maestro & System Events
# Task: Set Focus to Macro List
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @System_Events, @Keyboard_Maestro, @Focus, @Macro_List
--------------------------------------------------------

try
   
   tell application "System Events"
      tell application process "Keyboard Maestro"
         tell window "Keyboard Maestro Editor"
            tell scroll area 2 of splitter group 1 of group 1
               set focused to true
            end tell
         end tell
      end tell
   end tell
   
on error e number n
   set e to e & return & return & "Num: " & n
   if n ≠ -128 then
      try
         tell application (path to frontmost application as text) to set ddButton to button returned of ¬
            (display dialog e with title "ERROR!" buttons {"Copy Error Message", "Cancel", "OK"} ¬
               default button "OK" giving up after 30)
         if ddButton = "Copy Error Message" then set the clipboard to e
      end try
   end if
end try

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

Not sure what the best way to combine these macros together is, perhaps this?

try
   --------------------------------------------------------
   # User Settings:
   --------------------------------------------------------
   set macroGroupName to "e_Examples"
   --------------------------------------------------------
   
   tell application "Keyboard Maestro"
      
      if macro group macroGroupName exists then
         select macro group macroGroupName
      else
         error "Cannot select macro group " & macroGroupName & " — it is missing!"
      end if
      
   end tell
   
on error e number n
   set e to e & return & return & "Num: " & n
   if n ≠ -128 then
      try
         tell application (path to frontmost application as text) to set ddButton to button returned of ¬
            (display dialog e with title "ERROR!" buttons {"Copy Error Message", "Cancel", "OK"} ¬
               default button "OK" giving up after 30)
         if ddButton = "Copy Error Message" then set the clipboard to e
      end try
   end if
end try

try
   
   tell application "System Events"
      tell application process "Keyboard Maestro"
         tell window "Keyboard Maestro Editor"
            tell scroll area 2 of splitter group 1 of group 1
               set focused to true
            end tell
         end tell
      end tell
   end tell
   
on error e number n
   set e to e & return & return & "Num: " & n
   if n ≠ -128 then
      try
         tell application (path to frontmost application as text) to set ddButton to button returned of ¬
            (display dialog e with title "ERROR!" buttons {"Copy Error Message", "Cancel", "OK"} ¬
               default button "OK" giving up after 30)
         if ddButton = "Copy Error Message" then set the clipboard to e
      end try
   end if
end try

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

Thanks for sharing these @ccstone

Is there an update for this for Keyboard Maestro 9? I recently upgraded and this broke. It looks like it is a long press on the back carrot or long press on the command button and I'm not quite getting this to work.

--https://forum.keyboardmaestro.com/t/moving-the-focus-in-the-keyboard-maestro-editor/4184/17

--------------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2016/08/11 22:43
# dMod: 2016/08/11 23:33
# Appl: System Events & Keyboard Maestro Editor
# Task: Open Recently Run Macro Button's Menu
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @System_Events, @Keyboard_Maestro, @Editor, @Open, @Recently, @Run, @Menu
--------------------------------------------------------------------------------

tell application "System Events"
  
  tell application process "Keyboard Maestro"
    set frontmost to true
    
    tell window "Keyboard Maestro Editor"
      tell group 3
        tell button 1
          perform action "AXShowMenu" -- Open Recently Run Macros Menu
        end tell
      end tell
    end tell
  end tell
  
end tell

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

From what I can tell using UI Browser it should be group 4 now and button 1 for the Used (command) icon.

The problem is that the KM Editor window name has changed. See this for a solution:

1 Like

Thanks @JMichaelTX,

I should have mentioned that I did see that the window name had updated to show the macro you are on.

It seems like the problem is that the window needs me to long press to get the dropdown. I tried what I thought was the solution and and even did a test solution on the macro I had in front and it still didn't click long enough to get the dropdown.


# Script does NOT work
# Wrong window name.
# Wrong button name.

activate application "Keyboard Maestro"
tell application "System Events"
   tell process "Keyboard Maestro"
      button "⌘" of group 3 of window "Keyboard Maestro Editor — Keyboard Maestro - Show Most Recently Executed Macro v4 - (2) Choose From Recent Macros"
   end tell
end tell

I'm not sure how this holds the button and works but it does so thanks @JMichaelTX

Keyboard Maestro - Show Most Recently Executed Macro v4 - (2) Choose From Recent Macros.kmmacros (10.0 KB)


Macro Image (1)

image

Macro Image (2)

image


Here's a working AppleScript in a macro that I use many times a day.

  • Once the menu is open you can type-select to navigate.
  • To manually open this menu click and hold on the button.
  • Tested with:
    • Keyboard Maestro 9.0.2 on macOS 10.14.5 Mojave
    • Keyboard Maestro 10.2 on macOS 10.14.6 Mojave.

Open the Macro Edit History Button in the Keyboard Maestro Editor

Open Macro Edit History Button Menu of the KM Editor v1.00.kmmacros (2.8 KB)

Macro Image

Keyboard Maestro Export

AppleScript Code
--------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2016/08/11 22:43
# dMod: 2016/08/11 22:53 
# Appl: Keyboard Maestro Editor & System Events
# Task: Open the Macro Edit History Menu Button of the KM Editor.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @System_Events, @Keyboard_Maestro, @Editor, @History
# Vers: 1.00
--------------------------------------------------------
# REF:  https://forum.keyboardmaestro.com/t/moving-the-focus-in-the-keyboard-maestro-editor/4184/16
--------------------------------------------------------

tell application "System Events"
   tell application process "Keyboard Maestro"
      tell (first window whose subrole is "AXStandardWindow")
         tell button 1 of group 3
            
            # Open the History Button Menu.
            perform action "AXShowMenu"
            
         end tell
      end tell
   end tell
   
   key code 125 -- Select the first menu item.
   
end tell

--------------------------------------------------------
2 Likes

Moderators Note 2023/02/02 22:45 CDT


The Keyboard Maestro Editor now has the ability to directly select the last used macro.

Keyboard Maestro 8 added several useful menu commands:

  • View ➤ Last Used
  • View ➤ Last Edited
  • View ➤ Previous Edited
  • View ➤ Next Edited

Keyboard Maestro 10 (and 9?) refine that:


Continuing with @skillet's post:


I use this macro all the time but about a month or two ago it broke and I can't seem to fix it.

I am trying to automatically select the last run macro with a macro (meaning the macro run before I run the macro to find the last run macro).

I think this broke about a month before I upgraded to Keyboard Maestro 10. I have spent a while trying to modify it. I didn't use to have it look in the all Macros group but it just did. I added that and the list of dropdown doesn't seem to show the order of the most recent macros.

This Forum title does say pre-KM8 though what I had was working in version 8 and 9 until the very end.

Keyboard Maestro - Show Most Recently Executed Macro - (1) Open Most Recently Used Macros v5.kmmacros (24 KB)

Macro Image

Keyboard Maestro Export

While not an answer to your question about the macro you were using, as an alternative, this is the macro I've been using since KM 8 to show my recently used macros and quickly choose one for editing:

That is great thank you, neat to see another way to execute it. I appreciate you sharing that. Here's also a similar link to an alternative way to do it. I think from yours I can automate getting the last executed macro since I can't seem to figure it out from what I was doing.

Update: I think what is happening is it is command clicking on Modified instead of Used icon. Perhaps those were reassigned positions. I'll see what I can figure out and repost.

1 Like

Hey @skillet,

You can do this entirely with menu-selections – which are generally more robust than keyboard shortcuts.

Macro 2 uses an AppleScript to select the "All Macros" groups, and I think it's a bit faster than the menu-selection.

These work for me on Mojave.

-Chris


All Applications - Ultra Claw - Adam Macros.kmmacros (40 KB)

Macro Image (1)

image

Macro Image (2)

image

I was actually doing several of my macros with the menus and perhaps it was just in certain applications but in general it seems like the macros all ran slower so I often will group them and put the key command and the menu item in there.

This is very cool I was trying to do it with a Keyboard Maestro.

tell application "Keyboard Maestro"
   edit smart group "All Macros"
end tell

This action doesn't have the ability to show smart groups for some reason.
image

I really wish selecting the from the recently used menu didn't highlight the name of the Macro. I have never notice it do that before and think this might be something new in Keyboard Maestro 10.

A lot of these still use key commands but they are working though no doubt could be improved and sped up.

All Applications - Ultra Claw - Adam Macros (v10.0.1)

All Applications - Ultra Claw - Adam Macros.kmmacros (100 KB)

Thanks @gglick and @ccstone for the tips and help.

1 Like

I probably wasn't very clear but I was referring to the action Activate Macro group not the AppleScript.

If I type Tell application "Keyboard Maestro Engine" it doesn't work since I am trying to show the All Group in the Keyboard Maestro editor and not do anything directly to the engine if that makes sense.

All four of those macros I uploaded are tested and working on my end. They just might not be running as fast as they could be since they still feel a little clunky and slow but still faster than doing it by hand.

I think I was wrong. I think I understand now. I'm sorry. I'm not always right, especially when it comes to AppleScript. Let me reconsider. Perhaps your explanation was clear, and I was just dead wrong.

I've just never seen anyone use AppleScript to change the bahevior of the KM Editor. This is new ground for me. Sorry. I will feel bad about this mistake for a long time.

I've reconsidered, and I realize my first answer was truly inappropriate and wrong. Sorry. I hesitate to giver any further answers because it is likely to be wrong again.

But I will say that (a) you can "unselect the macro name" by sending a tab character to the editor; and (b) you can determine where the slowness is occurring by opening the debugger and watching which statements that the engine is hanging up on. If the actions are occurring so fast that you can't read their names, you can start your macros with a "Set Between actions Delay for this macro to 0.5 seconds" which would allow you to see better where the slowdown was occurring in the Debugger.

No need to feel bad and I am very grateful you responded. I consider anyone taking time out of their day to even try to help someone else out a kind gift.

Again, no problem and I am glad you replied and no worries at all, it is hard to know exactly what someone is trying to do. I always struggle with giving too little or too much information when I post.

The debugger is one I have spent some time with and watched a video from a few versions on and never really got my head completely wrapped around it. I am sure I could spend more time and need to practice using it more.

I feel like a dedicated class forcing me to go through the motions of several types of macros would be so helpful to me. I wish there was a week long class on Keyboard Maestro. I'd be all over that.

Thanks for accepting my apology. It will help me a lot.

I've seen @peternlewis recommend an online training thing, but I can't find it right now. Maybe he was referring to this:

https://computers.tutsplus.com/categories/keyboard-maestro

I find the debugger to be occasionally handy in figuring out where things are getting stuck. There's even an action in KM that turns on the debugger when one's code reaches a certain point. That can be handy too. But one needs to read really fast to be able to follow what's happening in the debugger window. That's why my idea above of putting a half second between each action might be helpful when using the debugger.

Hey @skillet,

That action doesn't have anything to do with showing the group in the editor

Activate Macro Group action

Try this one. It consolidates all activities into one AppleScript.

On my old MacBook Air it's a trifle slow, but hopefully on newer, faster hardware it will be faster than multiple actions.

-Chris


KM ⇢ Select Last Used Macro (AppleScript) v1.00.kmmacros (7.6 KB)
Keyboard Maestro Export


AppleScripts for the Keyboard Maestro Editor

  • Versions 9.x and 10.x

Select Macro Name or Group Name or Smart Group Name Field for Editing.


--------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2015/07/25 03:06
# dMod: 2021/09/30 17:17
# Appl: Keyboard Maestro & System Events
# Task: Select Macro Name or Group Name or Smart Group Name Field for Editing.
# Libs: ELb
# Osax: None
# Tags: @Applescript, @Script, @System_Events, @Keyboard_Maestro, @Select, @Name, @Field
--------------------------------------------------------

tell application "Keyboard Maestro"
   set kmVersion to its version
end tell

if kmVersion starts with "9." then
   
   tell application "System Events"
      tell application process "Keyboard Maestro"
         tell (first window whose subrole is "AXStandardWindow")
            tell group 1
               tell splitter group 1
                  tell scroll area 3
                     
                     tell scroll bar 1
                        if value ≠ 0 then set value to 0
                     end tell
                     
                     if exists (first text field whose accessibility description is "Macro Name") then
                        tell (first text field whose accessibility description is "Macro Name")
                           set focused to true
                        end tell
                        
                     else if exists (first text field whose accessibility description is "Macro Group Name") then
                        tell (first text field whose accessibility description is "Macro Group Name")
                           set focused to true
                        end tell
                        
                     else if exists (first text field whose accessibility description is "Smart Group Name") then
                        tell (first text field whose accessibility description is "Smart Group Name")
                           set focused to true
                        end tell
                        
                     end if
                     
                  end tell
               end tell
            end tell
         end tell
      end tell
   end tell
   
else if kmVersion starts with "10." then
   
   tell application "System Events"
      tell application process "Keyboard Maestro"
         tell (first window whose subrole is "AXStandardWindow")
            tell group 6
               tell splitter group 1
                  tell scroll area 3
                     
                     tell scroll bar 1
                        if value ≠ 0 then set value to 0
                     end tell
                     
                     if exists (first text field whose accessibility description is "Macro Name") then
                        
                        tell (first text field whose accessibility description is "Macro Name")
                           set focused to true
                        end tell
                        
                     else if exists (first text field whose accessibility description is "Macro Group Name") then
                        tell (first text field whose accessibility description is "Macro Group Name")
                           set focused to true
                        end tell
                        
                     else if exists (first text field whose accessibility description is "Smart Group Name") then
                        tell (first text field whose accessibility description is "Smart Group Name")
                           set focused to true
                        end tell
                        
                     end if
                     
                     
                  end tell
               end tell
            end tell
         end tell
      end tell
   end tell
   
   
   
end if

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

(*
--------------------------------------------------------

REVISION NOTES:

2018/01/12 00:36 ⇢ Streamlined for pure speed.
2018/04/10 03:45 ⇢ More flexibly handling macro group name or macro name ⇢ by name instead of number.
2019/02/20 04:29 ⇢ Added “Smart Group Name” to selector choice.

--------------------------------------------------------
*)

Select the First Action of the Macro Currently Being Edited


--------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2019/06/30 23:41
# dMod: 2021/10/09 20:28
# Appl: Keyboard Maestro & System Events
# Task: Select First Action of Current Macro
#     : Scroll if necessary.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @System_Events, @Keyboard_Maestro, @Select, @Name, @Field
--------------------------------------------------------

tell application "Keyboard Maestro" to set kmVersion to version

if kmVersion starts with "9." then
   # Keyboard Maestro v9.x.
   tell application "System Events"
      tell application process "Keyboard Maestro"
         tell (first window whose subrole is "AXStandardWindow")
            tell group 1
               tell splitter group 1
                  tell scroll area 3
                     
                     tell scroll bar 1
                        try
                           set value to 0
                        end try
                     end tell
                     
                  end tell
               end tell
            end tell
         end tell
      end tell
   end tell
   
else if kmVersion starts with "10." then
   
   # Keyboard Maestro v10.x.
   tell application "System Events"
      tell application process "Keyboard Maestro"
         tell (first window whose subrole is "AXStandardWindow")
            tell group 6
               tell splitter group 1
                  tell scroll area 3
                     tell scroll bar 1
                        try
                           set value to 0
                        end try
                     end tell
                  end tell
               end tell
            end tell
         end tell
      end tell
   end tell
   
end if

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

tell application "Keyboard Maestro"
   
   set selectedMacroList to selected macros
   
   if length of selectedMacroList = 0 then
      error "No macros are selected!"
      
   else if length of selectedMacroList = 1 then
      set currentMacro to item 1 of selectedMacroList
      
   else if length of selectedMacroList > 1 then
      error "Too many macros are selected!"
      
   end if
   
   select the first action of the currentMacro
   
end tell

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

(* CHANGE NOTES:

   - 2021/09/30 01:39
      - Added descriminator for KM 9 and KM 10.
      
*)

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

Select the Last Action of the Macro Currently Being Edited

--------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2019/06/30 23:41
# dMod: 2021/09/30 01:44
# Appl: Keyboard Maestro & System Events
# Task: Select Last Action of Current Macro
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @System_Events, @Keyboard_Maestro, @Select, @Name, @Field
--------------------------------------------------------

tell application "Keyboard Maestro" to set kmVersion to version

if kmVersion starts with "9." then
   # Keyboard Maestro v9.x.
   tell application "System Events"
      tell application process "Keyboard Maestro"
         tell (first window whose subrole is "AXStandardWindow")
            tell group 1
               tell splitter group 1
                  tell scroll area 3
                     
                     tell scroll bar 1
                        if value ≠ 1 then set value to 1
                     end tell
                     
                  end tell
               end tell
            end tell
         end tell
      end tell
   end tell
   
else if kmVersion starts with "10." then
   
   # Keyboard Maestro v10.x.
   tell application "System Events"
      tell application process "Keyboard Maestro"
         tell (first window whose subrole is "AXStandardWindow")
            tell group 6
               tell splitter group 1
                  tell scroll area 3
                     tell scroll bar 1
                        if value ≠ 1 then set value to 1
                     end tell
                  end tell
               end tell
            end tell
         end tell
      end tell
   end tell
   
end if

tell application "Keyboard Maestro"
   
   set selectedMacroList to selected macros
   
   if length of selectedMacroList = 0 then
      error "No macros are selected!"
      
   else if length of selectedMacroList = 1 then
      set currentMacro to item 1 of selectedMacroList
      
   else if length of selectedMacroList > 1 then
      error "Too many macros are selected!"
      
   end if
   
   select the last action of the currentMacro
   
end tell

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

(* CHANGE NOTES:

   - 2021/09/30 01:39
      - Added descriminator for KM 9 and KM 10.
      
*)

--------------------------------------------------------
2 Likes

The Macro Report…


Hey Folks,

The Keyboard Maestro Editor gives users significant flexibility in searching for and displaying macros.

However...

There is presently no built-in method of creating reports about macros, and the appended macro aims to improve upon that a bit.

The current search criteria are currently very limited:

  • Search String – macros whose name contains the string will be reported.
  • The string .all. will return a report of all macros

User Input:
Screen Shot 2023-02-03 at 02.30.45
Output contains Macro_Name, Macro_ID, and Parent_Macro_Group:

Output may be sent to BBEdit by enabling this user setting:

image

Many more things are possible, but this is a start...


Download: Find Macros Whose Name Contains a Search String v1.00.kmmacros (21 KB)

Macro Image


2 Likes