I often make mistakes, for example accidentally deleting the name of a macro or a mistake writing a technical note in a comment. The inability to undo (⌘Z)is frustrating.
thank you
I often make mistakes, for example accidentally deleting the name of a macro or a mistake writing a technical note in a comment. The inability to undo (⌘Z)is frustrating.
thank you
⌘Z works to undo in my editor and it's listed as the shortcut in the edit menu. Have you tried using it and it doesn't work, or?
Working as advertised here, though it can beachball for a moment or two. Have you remapped ⌘Z/⇧⌘Z to something else, perhaps?
I did 2 tests:
1- select all macro name, and "accidentally" type any character which will delete the macro name ( a common mistake I make). ⌘Z does. not work and is greyed out.
2- in a comment action, I type this is a test → delete it "by mistake". ⌘Z does. not work and is greyed out.
No. I use it many time a day and would notice immediately if it was remapped.
This is not a recent problem. As far as I can remember, I cannot undo in the KM editor which I thought was just the way it is constructed.
thank you both again.

Strange. I accidentally rename macros all the time with a single character because of how I rest my fingers on the home row, and I use ⌘Z to undo it every time.
It might be because you've got an absolute shed-load of macros, causing a timing/state problem. Try making a mistake, then click the action below that to force an update, then doing ⌘Z
I don't know what you are doing, but any change to the macros is undone with Command-Z.
If you select a macro name, type “x”, and the Command-Z the name is restored.
Unless you are using some archaic version of Keyboard Maestro (Undo/Redo was added in version 5), something is broken on your Mac.
Undo/Redo works by restoring the entire macro file, and is based on saved changes (you can see when a change is made by a small diamond marker shoring at the bottom right corner of the editor window, and that is removed when the macros are saved), and Undo undoes such a save.
The maximum Undo stack size is, by default, 200MB, so unless your macro file size is > 200MB or you have changed the undo stack size limit (hidden preference MaximumUndoSize) you would have at least one level of Undo.
I'd film an example of doing this, but this is such a basic functionality that has been around for a decade that it is clear it works, and for whatever reason it is broken on your Mac.
ver 11.0.4
definitely not possible on my Mac Studio M1
I can film it but the ScreenShot clearly shows that the undo menu items are inactive
I have many apps and this problem only happens in KM, which is why I asked the question.
I will do more research and reply. Thank you very much @peternlewis
thank you for the macro

I think that answers the question!
So you can either prune your macros or increase your undo buffer size (I assume that would also mean an increase to the Editor's memory footprint -- @peternlewis?).
To get one level of undo you'll need to get your plist below 200MB or run this in Terminal:
defaults write com.stairways.keyboardmaestro.editor MaximumUndoSize -int 250000000
...though that'll only give you 12MB of "spare" capacity.
For two levels of undo you'd need to get below 100MB or increase the buffer to at least 480MB, etc, etc
OK, yes, apparently your Keyboard Maestro Macros.plist file is >200MB.
All I can say is that is a bad idea, and I'm surprised you are not having more performance issues with the editor.
A large Keyboard Maestro Macros.plist file would be around 10MB.
I'd suggest you try to find a way to significantly reduce that - likely by removing large images and putting them in files.
But otherwise, if the performance is ok, and you have a really powerful Mac with a ton of memory, you can try just increasing the Undo stack size limit. But I still recommend seriously reducing the size of your macro file (not necessarily the number of macros, but the size of the overall file).
@Nige_S You are fantastic ! Incredible.
Thank you @peternlewis and @hemicyon for your help.
Thanks to your help, I have a plan.
1- sort by size
2- deal with all the comments and windows full of technical annotated images.
3- run @Nige_S ' s macro until I get a reasonable plist capacity
1- what would be the simplest way keep the content (large images) of comments in the macro", ie some way of bringing up the images while perusing the macro in the KM editor (not to be displayed when the macro runs).
thanks again very much
It sounds like you've got a lot of your macro documentation in your macros complete with images. I would move that out. You could do something like move your documentation to Obsidian and then link back to KM and in KM link to your obsidian documentation, and keep your comments to text only.
Keeping your KM size under control will benefit you in so many ways.
For reference I've been using KM for over 10 years. Here's my plist size

yes, absolutely.
I will move the documentation to bear notes. That's the type of solution I was looking for.
thank you very much !
You should write a KM macro to grab information about your macro and create a bear note then link back to the macro!
Great idea !
I have such a macro which I took from this forum. Works perfectly
thanks again !
I suggested exactly that two years ago, didn’t I, @ronald! ![]()
Well, whether it’s Obsidian or Bear, good luck with reorganising the notes. Perhaps that task in itself might call upon your macro skills!
Yes you are right. My apologies.
The undo works fine. I am perplexed for many reasons.

the plist size quickly decreased from 238 to 145.6 MB and the Buffer stayed the same at 200, but afterwards, despite deleting a huge number (hundreds) of image containing actions (mostly comments) when I select macros at the top of the sort by size, it stays exactly the same at 145.6 and the buffer identical at 200.
Yes, I have 7,580 macros BUT it does not seem like that. The question is: what counts as a macro ?
thank you