How can I list the macros inside a folder in KM?

I'd like to create a macro that lists the macros inside a particular folder on KM. Is it possible?

CloudApp

The reason is that I often forget about the macros I have created for a particular app that that would come in handy. Then i could invoke from alfred "showmacros Wunderlist" and it will show me everything under folder Wunderlist.

I looked in the applescript dictionary for KM and it doesn't seem possible

CloudApp

Cheers,

Leo

Hey Leo,

Conventionally it's not, but it's hackable if you want to parse the KM macro plist file.

set pListPath to ((path to application support from user domain as text) & "Keyboard Maestro:Keyboard Maestro Macros.plist")
set macroGroupNameList to {}

tell application "System Events"
  tell property list file pListPath
    tell property list item "MacroGroups"
      tell (first property list item where its text contains "Wunderlist")
        set macroList to item 2 of (get value of property list items)
        repeat with i in macroList
          set end of macroGroupNameList to |name| of i
        end repeat
      end tell
    end tell
  end tell
end tell

macroGroupNameList

Note: You do know that Keyboard Maestro has it's own |List Macros by Name| action to list all macros available in the current app.

--
Best Regards,
Chris

Hello Chris, thanks for replying. I got his message when executing the javascript and I don’t know how to debug it. http://cl.ly/image/0c0Z06003Z1k

I am often wrong but I think Keyboard Maestro does not have any action that list it’s own macros.

Thanks for the reply again

The Trigger by Macro Name action lists the active macros and lets you select one of them to execute (or edit).

Where is this “Trigger by Macro Name” action?

Hey Leo,

Send me the following file off-list to: listmeister@thestoneforge.com

~/Library/Application Support/Keyboard Maestro/Keyboard Maestro Macros.plist

Parsing plists is a royal pain, so it's easier if I do the debugging.

[quote]I am often wrong but I think Keyboard Maestro does not have any action that list it's own macros.
[/quote]

Search the {All Macros} group for "trigger". You'll find {Trigger Macro by Name}.

It shows a list of all available macros in the current context. E.g. only those macros that are active and available.

--
Best Regards,
Chris

Hmm, searching the All Macros for ‘trigger’ yields nothing. Maybe it somehow got accidentally deleted. What can I do to get it back?

Hey Carl,

In the Actions Inspector (Cmd-K) in the View menu.

Not {All Macros} in {Groups}.

--
Best Regards,
Chris

Thanks, I found it.

There is a pre-made Trigger Macro by Name macro in the Macro Library, you can simply double click it to install it.

If you want to use lists in Keyboard Maestro more palettes and AppleScript I have an older post sitting here. It might be a good starting point to get a rough idea of what’s possible.