How do I import my whole macro library?

Hi, I have a whole bunch of folders off macros on one MacBook-I recently purchased another backup MacBook and would like to copy all the macros along with the folder structure What is the best way to accomplish this? When I research this, I came across a way to open up individual macros - but that would take too long. Is there a short way to do it?

I have them saved in folders and subfolders.
Thank you

Read how in the FAQ Frequently Asked Questions [Keyboard Maestro Wiki]

You can export, and import, folders of macros -- you can even multiple-select folders.

But before you go this route -- how are you going to keep your backup MacBook up to date as macros change on your primary? Now would be a good time to investigate macro syncing, which is much easier to set up when one machine is a clean slate.

Thank you for the reply - actually both Macs are different resolution - MacBook Pro and MacBook Air. Most of my macros are based on image recognition - so I don't intend to keep them synced.

So your backup is a 2017 or earlier non-Retina model? Even if it is a problem I still wouldn't dismiss syncing out of hand -- if you are going to go through and replace every image on imported macros, it's not that much more work to add both versions to synced ones.

I have MacBook Pro M3 and MacBook Air M3.
It makes sense to sync - but I thought that if I sync - the images would be over written - what I mean is if the Pro has one image -and if I sync all the macros to Air and then change the images on the Air - would the images on the Pro be replaced ?

That is correct, so for places that use images you will want to differentiate between the two, you would need to conditionally use different actions with different images, along the lines of:

  • If MacName token is “Whatever”
    • Do stuff with image 1
  • Else
    • Do stuff with image 2

That said, it'd be surprising if most of your macros are like this. Usually that would only be a small set of actions.

Got it - Thank you !!!

1 Like

Peter's covered the "if the images change" scenario. But one question is "Why would they?".

It doesn't matter to you, since both displays are Retina, but KM has little problem matching up a image captured on a Retina display with one displayed on a non-Retina -- I can make an image-detecting macro using a screen shot taken my 5K iMac's screen then move the target to my second, QHD, display and the action works just fine.

That's for fixed-size elements, like most interface widgets. Where you might have problems is with:

  1. Images that scale dimension in pixels with window/screen size
  2. Elements that reposition with window/screen size and you're restricting search to a defined area
  3. Actions that use an offset from a found image, and that offset can vary with window/screen size

The first you can handle with device identification as Peter described but, in many cases, you can just double up with a "Try/Catch" action -- try and match the first variant, but if that fails then try and match the second.

The second and third you can usually solve by not using "absolute" values, instead using percentages of window/screen dimensions.

In extreme cases you may have to fix your window size to something that works on both displays, though I've found that to be pretty rare.

The above may seem like a lot of extra effort but, IMO, having the same macros behaving the same (or, at least, in a similar) way on both machines and having them "auto-update" when you make the inevitable tweaks and changes is well worth it. I've just gone from separate installs on multiple devices to a synced setup and most of my problems were the result of different OS and app versions -- hopefully not something you'll have to deal with!

This seems to work very well - extremely grateful for all you help !!!!!
Thank you.