Diffing .kmsync file

In the process of replacing an aging MBP and upgrading the other to Monterey, Dropbox syncing stopped. I didn't notice it right away because I also started using iCloud to handle the Documents folder.

Dropbox is now working, but my KM macros are out of sync and I have several conflicted copies. Can I find the differences? Not the end of the world if I just have to use one or the other.

That depends upon what you mean. There's no way to simply diff the sync file and tell what macros are different.

Personally I would NOT mess with the sync file.

I'd go the the Mac with the latest set of macros and use the files from the ~/Library/Application Support/Keyboard Maestro/ folder.

(Time Machine may or may not be of use here, depending upon how you've kept backups.)

If I couldn’t then I'd try using KME › File › Revert Macros.

You can get a whole lot of information about macros using AppleScript:

image

tell application "Keyboard Maestro"
   tell (first macro whose selected is true)

      # return its properties --<<-- Uncomment to see  all properties.
      set macroModDate to its modification date

   end tell
end tell

If I was doing this I'd also be very careful to keep backups of everything...

You could write an AppleScript to extract the name of every macro, its macro group name, and its modification date to a flat record.

You could do the same with any set of macros loaded in Keyboard Maestro at a given time, and then diff that in BBEdit (or similar).

That would get the data-set your diffing down to something reasonable.

-Chris

@ccstone Thank you, I suspected as much. Happily I didn't seem to be out of sync. KM on iMac synced with the changes on made on my MBP. Guess I hadn't changed anything on the iMac. I do see some older conflict files. So I'll just try and pay more attention to making sure sync is working.

1 Like