Left Macro Recorder running, Now I can't open KM

Somehow I guess I left Macro recorder running for a couple of hours while I was very active on the computer. Now I can't open KM. I tried rebooting. I get the outline of the KM window but I waited an hour and it's still just the outline.

I noticed my Mac getting very slow and sluggish. I'm guessing the recorded macro got huge. Can I delete that one macro from User/name/Library/App../KM? I see just a plists and it won't open in a text editor.

Alternatively, I could back up from a Carbon Copy Cloner clone, but I would lose a few hours of work from this morning.

Any way to delete one of the macros without starting the KM GUI?

thank you for reading

Hi Cliff,

I think the solution would be to remove (ora first rename/move) the plist file from ~/Library/Application Support/KeyboardMaestro (where all macros are stored as per this forum thread).
As far as I understand it should then be possible to restore only that file from you CCC clone?

Hope this helps.

René

Hey Cliff,

As @Reheer mentions I'd take a look at the ~/Library/Application Support/Keyboard Maestro folder.

See how big this file is:

~/Library/Application Support/Keyboard Maestro/Keyboard Maestro Macros.plist

If it is quite large save a copy to the Desktop, and use Time Machine to go back a few hours.

If you have crucial macros that can't be restored in this way it's possible that @peternlewis can help you hack the file itself.

Contact Keyboard Maestro Support

-Chris

Try running the terminal command:

defaults delete com.stairways.keyboardmaestro.editor MacrosWindowControllerSettings

That setting holds the open editor windows and their selections and such. With that deleted, the macro selection should be forgotten. Then you should be able to ensure Edit mode is turned off, and then hopefully select the macro and delete it.

If the editor locks up even with Edit mode turned off, then try turning Edit mode on, select a macro and duplicate it - select the sacrificial duplicated macro, and command-select the faulty macro and then delete both.

Alternatively, select File ➤ Revert Macros ➤ and whatever is the most recent date. You will lose any changes you made on the same day as the problem, but the remaining macros will be available.

1 Like

I backed up the folders when I saw your email notification, but forgot to come back here and say thank you, so 'thanks'.

Hi ccstone,

The odd thing was the old macros.plist was 750 K and the new one was only 900 K. I was expecting like 30 megs, but nope, it was only a little bit larger. I suppose storing the commands doesn't take much space, but loading 3000 commands into the editor might be too much for the editor.

thanks for your reply

1 Like

Ah ha! Your command worked perfectly. I couldn't find the 'edit mode off' anywhere so I used that clever "second file selected with command" method. After I was all fixed and back in service I went looking again and found editing mode under.

View >> Stop Editing

All I lost was the one 'test' macro with apparently a billion recorded commands in it.

so,
thank you
thank you
thank you

Would it make sense to you that I left KM macro recorder running for a few hours by mistake while I was actively using the mac, and that after a few hours it slowed my mac down noticeably, and that the 'macros.plist' would only have grown by 150 K?

I guess if it's all stored in json or xml the file size wouldn't have to get very big to choke the GUI while loading it.

Outstanding!

I look forward to @peternlewis' technical explanation.

-Chris

Simple actions are pretty small, only a few hundred bytes each, but then the file is stored in binary, and so all the strings are highly compressed, so in practice each action is probably only about 30 bytes (it's easy enough to test, check the exact size of your Keyboard Maestro Macros.plist file, and then add an action, and then check the new size).

But the issue isn't really the actions, it is editing them - the engine probably would not care at all and would execute the 5000 actions without breaking a sweat. But the editor displaying all those actions, with tens of thousands of text fields, probably a hundred thousand view elements, in a huge scrolling panel, the system would be thoroughly unimpressed with that.

This is why my suggested solution worked - the editor doesn't really care about the number of actions in there, just actually trying to display the macro for editing is too much for the system to cope with - I would have to have some different thing that allowed only part of the macro to be displayed at any given time, rather than just relying on the system to scroll it. But since macros with thousands of actions are well past what Keyboard Maestro is designed for, that's not something I would do - in this case a better solution would just arbitrarily limit the number of actions you are allowed, but I would not want to do that.

1 Like

Thanks for the explanation Peter!

-Chris

Peter,

Thank you sir.

Cliff