How To Restore Deleted Macro

First of all, I am VERY disappointed in how KM handles the deletion of a macro:

  1. There is NO confirmation of the deletion
  2. The UI is too sloppy – it is easy to delete a Macro when all you wanted to do is delete an Action Step in a Macro
  3. The deletion is immediately permanent. There is no undo or Trash for deletions.

This just happened to me with a complicated Macro. After I recovered from my panic attack, I did a Google search, and a KM doc search, and did not find anything to help recover from macro deletion. Allthough there is a related article in these forums dealing with restore from TM, it did NOT show up in in a Google Search

Fortunately, I had setup KM to sync with DropBox, which, with Version Control, saved my a$$.

So, for anyone reading, I urge you to immediately setup your KM to sync with DropBox, even if you don’t plan on syncing it with another Mac. DropBox is your ONLY short-term recovery since KM itself offers NO recovery. TM can help, but most likely it will be at least a day old.

You can Undo a macro deletion, hence there is no need for confirmation.

You can also revert to a previous days macros (File ➤ Revert Macros), copy or export the macro, revert back and then paste or import the macro.

Also, of course, you should have daily automatic complete backups, and then you can restore your macros from there as well as anything else you might lose by any other means.

This is completely untrue, Keyboard Maestro has several layers of mechanisms to restore deleted macros, starting with Undo.

Peter, thanks for the reply.

I have to disagree on the need for a confirmation, regardless of whether or not an undo is available. It is way too easy to hit the large DELETE key without knowing it, and it is hard to know in KM whether you are deleting an Action or Macro.

I did NOT know about an “Undo”, even though after discovering later that I had accidently deleted a complicated Macro that I had just created earlier in the day.

Perhaps one of the problems is lack of documentation.
As I stated in my OP, I did do my due diligence, searching in both Google and in KM documentation, and I found NOTHING about deletion or restoring deleted Macros.

IAC, none of the KM “layers of mechanisms to restore” are of much use for big changes made within the same day.

Please keep in mind the perspective of a very new KM user. “Undo” (CMD-Z) is most often used to undo a text change within a document. Most modern Mac apps that have objects like “Macros” have a Trash container to allow the user to easily find and restore deletions of these objects.

It seems to me that it would not be that hard to add a Confirmation, with a setting in Preferences of whether or not to use.

Thanks for a great product.

Hi, I have a simlar problem, though not exactly the same.
I have just started using Keyboard Maestro, and I really like it; I have two or three laptops that I bounce between; I’m developing a batch production style macro on one, and running it on the others. They are all syncing using the ^File^StartSyncingMacros feature where the file is located on directory that is associated with a cloud service (MEGASync). I thought this would be the best setup for me. I’ve been doing it for a two or three days and everything has been working fine. Today though I’m experiencing regression of the macro version. That is, I keep automagically loosing my edits. This has happened a few times now. I even just created an entirely new macro this morning, developed it for three hours, and then hay presto, it’s disappeared entirely. MEGASync does not keep a history like DropBox. My question is, “Is there any way I can get at the macro history to recover the macros I developed”?

Update: I’ve turned off Sync on all three laptops. I did a ^RevertMacros^BeforeLastSync, and my macro is back again at its last edit. Great. Lesson learnt, I’ll stay clear of syncing and do my own distribution to the other two laptops. It’s a bit more work, but that’s OK.

I’m glad you found the Revert to Before Last Sync and rescued the macro (it makes it very worthwhile that I spent the time on that feature!).

It sounds like MEGASync is not behaving very well. Syncing is hard, which is why Keyboard Maestro relies on a third party service to do it and why I did not try to implement it myself. In my experience, Dropbox is about the only syncing service that works reliably (which is a shame as I’d like to be able to recommend options).

Since I made that comment over 2 years ago, Keyboard Maestro has been changed so that it now requires a CMD-DELETE to delete a Macro. Normal DELETE still deletes an Action.

Thanks for that change, @peternlewis. I would still prefer a confirmation on Macro deletion, since it rarely happens, and has a much, much bigger impact. I know the macOS does not give us a confirmation on file/folder deletion, but actually it is just moving the item to the Trash.

Of course, both Macros and Actions can be restored by a CMD-Z.

Thanks. Appreciate your quick response. If the manual distribution becomes too much of a chore I’ll try DropBox.

I've been using DropBox for years now to sync a large variety of files and apps, including KM Macros. I've never had any issues and DB provides a restore file from prior version and deletion.

To delete a file in the Finder you have to select it and press ⌥⌘⌫ (note the ⌥ key). And it sure asks you for confirmation (fortunately!):

This has been introduced with El Capitan and is called “Delete Immediately” (File menu):

See also my nice blog post :wink:

1 Like

Hi. I just worked some hours on a new Macro an accidently klicked on delete.
Any change to get it back?
a tired and exhausted
Juergen

Try Z

2 Likes

Peter, I think most users, including me, would disagree with that.
Deleting a KM Macro is like deleting (NOT moving to trash) a macOS file.

When DELETING a file, it DOES provide a confirmation:

And, we had another user bit by accidential deletion:

So please, @peternlewis, add a confirmation to the Macro and Macro Group Deletions.

There is pretty much never a confirmation on a Mac for an Undoable action.

Of course there is a confirmation on “Delete Immediately”, because its right there in the dialog:

image

If you delete something in Keyboard Maestro accidentally, that is what Undo is for - specifically to avoid confirmation dialogs.

@peternlewis: I've had great success with Resilio Sync

Peter, forget about the technical details. Just consider the point of view of many of your users who accidently delete a Macro, and do not realize it for a while -- long after an undo will work.

What's the harm in presenting a confirmation of deleting such an important entity as a KM Macro? You can set the default key to "Delete", so it is a very minor inconvenience to those users who know what they are doing.

Please reconsider this request.

Thanks.

It's true: the couple of times this has happened to me, I didn't realize until days later. Thanks.

Peter, thank you for your implementation of Undo in KM. It's saved my bacon many times.

I agree that it's easy to accidentally delete a Macro, but I'm not sure if I agree about the need for a delete confirmation, unless it's accompanied by a "don't show in future" check box.

I do agree that some additional documentation would be helpful (copy what you wrote above and paste into the doco).

For me, when a Macro goes missing, I rarely notice immediately. When I realize it, I have to search for a solution - which led me to this forum post - which is a time drain. At that point, I've likely made other changes... undo repeatedly until I find the deleted macro, copy it, then redo all, paste macro. Of course, as devoy noted, if I realize days later, KM has been quit. In that situation, it's off to the backups.

I just decided to do is create a disabled Group called "zzzzzzz TRASH zzzzzzz" (name pushes it to bottom of list). This will help for any macros I intend to delete, but not macros I accidentally delete.

Additionally, noting in the doco the levels (#) of undos could be useful.
In a perfect world, implementing a History feature as seen in photoshop.