How to import a folder of macros previously exported?

I exported all my KM macros using File>export>export as folder and now I want to import that same folder to overwrite all my macros.

I see someone posted the same question, but neither solution given there worked for me. That is, I tried

  1. File > import > but the “import macros safely” only allowed me to import individual macros – which I don’t want (I want to import all of them at once)

  2. I tried dragging my macro folder in the Finder on the KM icon on the dock, onto the KM icon in the application folder, and into the KM application window. Nothing happened.

  3. I tried right clicking my macro folder and select “open” and it just opened all the folders

How do I import the macros in this exported folder?

Not sure why no one replied, but after struggling with this for hours I thought I’d post my results.

I used chatGPT and it said Keyboard Maestro could not do a simple import of the folder structure it exports. Instead, it said you have to import each .kmmacros file individually; which is very difficult since then I would have to open 42 folders, select all and open them.

Then I was told a bash command that would do it all at once – that didn’t work

Then I was told I could use the MacOS find feature and filter all by the .kmmacros file extension. Since file extension didn’t appear in the menu (it had “name and “kind”) I had to add it using the “other…” option.

When that filtering did not work I finally realized that all the .kmmacros files had somehow become .kmmacros.xml – so I filtered by that extension and it worked. I then copied all of those into another folder and tried to open them. I tried to force KM to open that extension but it didn’t work.

So I converted them back to .kmmacros, copied to another folder, and this time when I opened all of them they did import into KM. However, now I had duplicates everywhere. Fortunately KM allowed me to undo that import.

Throughout my life I’ve probably exported and succesfully imported data in dozens of programs. But somehow KM has beaten me in this long string of success. I remain bewildered as to why something that seems so obvious doesn’t work in KM.

Hi Tony.

Glad you figured out your problem. This forum is generally much more active on weekdays so you’ll see responses quicker generally, but also remember these are just folks volunteering their help!

That said, I know it’s “the thing” right now, but I’d encourage you to reach for the in app help menus, and wiki for information on how the software is used, as LLMs are notoriously fuzzy about specifics.

You don’t mention why you chose the “Export as Folder” option, but if you just want to be able to easily import a lot of macros later, i’d suggest instead using the “Export Macros” option, as that combines the selected macros / groups into a single .kmmacrosfile which can be imported very quickly and maintains the macro group structure of the exported macros.

See wiki for more details. manual:Menus [Keyboard Maestro Wiki]

2 Likes

I’d encourage you to reach for the in app help menus, and wiki for information on how the software is used,

@Evan_Mangiamele Yes, I did look in the help, but I was focused on the “Export as Folder” because I was concerned to maintain my folder structure so that made a lot of sense to me. For example, the “Export Macros…” option you mention is a little confusing in this regard. Yes, it says if you select a macro group it will export all within, but what about 2 macro groups? What about 42? Plus, some special macro groups are confusing like “All” and “Enabled Macros” – do I select them too? If I do will I get duplicates everywhere? As I wrote, I demonstrated the latter is possible. So, the Export as Folder made the most sense to me since I wanted to preserve folder structure.

But I’m certainly not wed to it – It’s just that if you can’t easily import what you’ve just exported that way, I think a suitable message would be in order: Warning: choosing this method with many folders will lead to a pain in the butt if you ever want to import what you’ve exported this way!

Yeah I understand about the folder confusion. Basically, anything selected when you “Export Macros…” goes back where it started, no matter how many groups / macros are selected. The easiest way to get a handle on it is to just try it, as you can quickly undo any imports!

1 Like

@Evan_Mangiamele That info about the folder structure is helpful. Actually, I’ve been making regular backups of my KM macros this way for at least a year and recently restored a CCC backup and lost some of them by accident. That’s why I wanted to import the most recent KM folder backup to catch those I’d made recently. But after seeing how difficult it was finally went ahead and set up the iCloud method going forward which I probably should have done from the beginning.

Anyway, hopefully my experience will help someone