Feature requests: Easy way to backup and restore macros, separate windows for macros, turn off auto-save

I have 3 feature requests - if any of these can be done now, could you please point me in the right direction?

  1. Turn off automatic saving of macros - often when working on a macro, I add or change a step and find out that the step is incorrect or unnecessary. Unfortunately all the changes get saved as I am working on the macro, potentially saving a ruined version of an existing macro. It would be nice if one could work on a macro, then MANUALLY do a Save or Save As, thus protecting an existing macro. (I know one can duplicate a macro and work on the duplicate, but then you have to clean up/delete the unneeded macros when one is finished...)

  2. It would be great if you could have two (or more) macros open for inspection at the same time - this way you could compare steps and copy steps from one to the other. I know you can open a macro, copy the parts you want to transfer, then open the new/other macro and paste the part, but this is much more cumbersome than just having windows for the various macros open at the same time.

  3. An easy and efficient method for backing up/restoring either all one's macros and/or just selected macros. There are numerous methods out there for doing these things, but they all seem like kludges (no offense meant...). It would be great if there was a built-in, and simple method for doing this. (For example, if one could just drag macros or folders to the desktop and have the macros be copied there. And the reverse for putting them back into KM. Or something else, but equally simple.)

Thanks

@Tomas, I completely agree with all of your requests.
AFAIK, none of these can be done currently.

I develop a lot of macros, and I struggle daily with exactly the issues you describe.

@peternlewis, if you don't have any of these in your wishlist queue, please add.

BTW, my biggest need is #3 -- restore a single Macro.
I know we can use Revert Macros, but AFAIK that doesn't work with changes made the same day, like 15 min ago. Another issue with Revert Macros is that it may restore problem macros that will be running while I try to get a file backup of the one Macro I do want restored.

The current design in which ALL Macros are in ONE file does not lend itself to any type of backup/restore scheme using traditional/conventional tools. Even though my KM maco sync file is in my Dropbox folder, and I can easily download a prior version, it is extremely hard to find and extract a specific macro from the sync file.

Thanks for considering these requests.

Peter - where is this Wishlist Queue you mentioned?

That was just my name for Peter's internal feature request list.

Quit & Relaunch the Keyboard Maestro editor. At that point there is a specific revision for when you launch the Keyboard Maestro editor.

Make any changes you want. Use Undo/Redo as desired.

At any time you can abort the entire process by using File ➤ Revert Macros to At Editor Launch

You can. Oh wait, never mind, I mean I can. You'll have to wait a while.

You can't drag them (dragging to create a file is actually surprisingly complicated), but you can select them and File ➤ Export Macros and export them. There is no direct support for AppleScript control over exporting a macro or macro group, but you wanted to do this regularly you could add a command key to Export Macros… and then the process would be pretty much: your command key, Command-D, Return to export the macro.

And you can re-import them by dragging the file back from the desktop.

So I am not really sure what more you are after in this.

1 Like

So, if I am editing, and have not previously on the same day quit, and I make a blunder (like I did the other day), how do I restore the Macro to the version just before I make the blunder? Note that I have also moved to editing other macros, so the "Undo" feature is not available.

Any chance you could provide us with a tool to extract to file a specific Mac (like the one currently open) from the KM Macro sync file?

I use DropBox to store the KM Macro sync file, so I can easily use DropBox to download an earlier copy of it. Now I just need a tool to get a Macro out of the Sync File.

BTW, how often is the Sync File updated, and what triggers the update?

Thanks.

  • Undo until the macro is restored
  • Export your recovered macro
  • Redo until you have redone everything
  • Import your recovered macro.

It's just XML. The files are slightly different from export files, but not much. I'm probably nto going to write a tool to extract a macro from a kmsync (or Keyboard Maestro Macros.plist) file (both are the same format) into an Exported Macros file, but it would not be overly difficult. Mostly it would be just a matter of deleting all the other macros and macro groups and slightly massaging the format.

Every time you change your macros. They are copied to the sync file at more or less the same time they are written to the macros file.

If I understand your process, that won't work for me.

I over-wrote the contents of a complex Comment action, but then I did other work on the macro.
It was ~30 min later when I discovered my error, and when I put the text cursor back in the comment Action, "Undo" was disabled in the Edit menu, not available.

It would be great if KM could work like Script Debugger, and other macOS apps that use the system versioning feature. Every time I do a SAVE in SD, it creates a new version, and I can easily restore to any of those versions, or copy a version, using a Time Machine like UI.

I hope you will reconsider. It may not be "overly difficult" for you, since you already have a bunch of code that gets and saves the Macro XML. But at least for me, it is a huge task since I don't have any XML tools, and very little experience with it.

Don't undo the comment change per se, undo all your work.

You could do it in BBEdit for one-off cases, which is what I would do, which is why I wouldn't spend the time to write a tool for it.

I tried BBEdit. It chokes on my very large (880,290 lines) KM sync file. (I have 2,000+ macros).

The problem is not just finding the macro, but getting the Macro Group and other XML stuff needed to create a proper .kmmacros file.

I also often times have the need to view 2 macros side-by-side but I never got around to asking for this feature request. +1 for this feature.

Thanks.

1 Like

Really? I've never known BBEdit to choke on such a small file. I've edited files that have millions of lines in BBEdit without issue, so I'm surprised it would choke on a Keyboard Maestro sync file.

This has nothing to do with this topic, so it would be better done as a new topic — or just adding to the existing topic (eg here) where I say

Luckily for all of you, I am extremely technically proficient.

4 Likes

Peter, it was taking ~24 sec to open.
I submitted a support case to BBEdit, and problem solved:

The delay in opening your file is the result of the computation required to calculate soft wrap points, because the file is set to soft wrap to the window's width.

Try changing the Soft Wrap Text setting in BBEdit's "Editor Defaults" to "Page guide", and I think you'll find that this file, as well as others which behave similarly, will take much less time to open.

The same file now takes < 1 sec to open.

2 Likes