How to recover macros lost due to sync issues (i.e. iCloud)

I stumbled upon this problem several times and tried to troubleshoot it here. I was just also going through Bug: Losing Changes in Macros

Somewhat by accident, I discovered a way to recover the macros. This works for iCloud, not sure about other service providers.

  1. Navigate to your iCloud .kmsync file location
  2. Double click it. This should open a pop up window notifying you about a sync conflict, prompting you for a resolution
  3. Tick checkboxes for the last few snapshots (in my case, I narrowed it to 2, several hours apart).
  4. Save these files
  5. Go to Keyboard Maestro's General Preferences, uncheck and check again Sync Macros
  6. Load the file of choice (if you're not sure which one, make an educated guess based on the edit time and file size – you can always repeat steps 5–6 with another file)

In my case, I was fortunate enough to recover a dozen of my macros that I've created yesterday.

Just to let you know, for some reason double clicking any of the recovered .kmsync files directly won't load them to Keyboard Maestro, it has to be done via the Sync Macros checkbox route.

1 Like

Option 2: Don’t use iCloud... :sweat_smile: Nah but all jokes aside, thanks for this info. I know a number of users do use iCloud for library syncing, so no doubt they’ll benefit from this.

Yeah I've actually just moved my kmsync file to the Shared folder (as I need it for two local macOS user profiles, so it's good for me) and I'm coding a backup iCloud sync with Automator that monitors the changes in the Shared/KM folder

Hi krzemian,

I had the same problems from time to time.

Could you please describe your approach to monitor the Shared/KM folder?
Does it mean any changes to the shared folder's content (= the sync file) will duplicate the sync file to an iCloud folder, replacing the one already there and from that file KM on the second Mac will sync?

I’m having exactly this issue. I have some lengthy sets of macros, for example a list of locations to label photos in Photos.app. I laboriously modified my whole list recently, and come to find that all the modifications are lost.

I use iCloud for syncing, but lately I’m only really using one of my Macs most of the time and the secondary Mac is shut down. Is the problem that when I start the secondary Mac KM syncs from an old sync file, overwriting my new one? Is there a way to specify that sync only works in one direction? I could live without syncing, but it has worked for many years.

I followed the instructions above, but when I get to step 6 I get into an endless loop of a dialog box that says Modifications aren’t in sync. Choose which versions to keep. I choose one and click Keep and the dialog reappears.

Update:

Though the problem I described above persists, at some point I did recover the large modified list of text macros.

Keyboard Maestro also keeps daily revisions of your macros available via the File ➤ Revert menu.

So a relatively safe way to restore macros that have been deleted for any reason is:

  • Quit & Relaunch the Keyboard Maestro editor (this sets a known point in time that we can safely use later)
  • File ➤ Revert to whenever the macros were available.
  • Export or Copy the desired macros.
  • File ➤ Revert to When Editor Launched (hence the need first step) - alternatively you can use Revert to Before Last Revert, but that is more fragile.
  • Import or Paste the desired macros.
1 Like