How to quickly export all available macro groups as macro libraries and save it to a folder?

As I want to share all the KM macros I use with other people. I have a problem where sharing it all is actually a problem. Because in my current way, I have to manually go through my 60+ macro groups and manually export each macro group as a macro library with a menu bar action:


I would ideally have a script or perhaps a macro that when activated will export all the macro groups I have in Keyboard Maestro as separate macro libraries essentially fully automating this process.

Is this possible to do? And if yes, how can I do it?

Don't use Macro Libraries, just use Export Macros.

Select all the groups you want to export, and then select File ➤ Export Macros… to export all the groups.

Then import them on the target Mac - hold the option key down to avoid having them disabled (for safety) and select File ➤ Import Macros… to import them.


The issue there is that it exports ALL macros embedded in one file. This is bad because a person might only want my macros for Keyboard Maestro or Open Websites but not everything else.

This is the reason I had to manually export each group into bundle one by one to give the choice of what the users can import.

If you want to export them as individual macros (or macro groups?), then you would have to do it manually (probably automating the process like you would automate any other application).

There is no current AppleScript support for exporting macros, so it's not entirely easy to do with a straight AppleScript, but you can select macros and macro groups with AppleScript, so there are a number of ways you could automate it.

There is a todo item somewhere to allow exporting a set of macros into some sort of HTML archive structure for this sort of sharing purpose, but it is unlikely to be done any time soon.

Yes I want to export them as macro groups. The end result should look like this:


I tried doing that but didn't have a solution that I was happy with. It was too finicky and slow and required my manual input at all steps. :disappointed:

If anyone can help me create a macro that would create this kind of export in an automated and ideally fast way, I would love to pay back how I can as it would save me a lot of time.

Would be amazing to see.