Can't "Start Editing Macros" then "Stop Editing Macros" in a single macro?

I have a macro that needs to have "Editing Macros" to be true, i.e. "View->Start Editing Macros". So I check to see if the "Start Editing Macros" menu item is present, and if it is, "click" it.

Works great.

Then I do something, then I want to change it back to no longer be editing macros.

Start Editing Macros then Stop Editing Macros.kmmacros (5.2 KB)

But when I try to execute the "Select Menu Item" action to "click" on "Stop Editing Macros", it says it can't find the menu item.

I know the menu action itself works, because I can run it by itself and it works.

But for some reason, I can't "start" and then "stop" editing macros within a single macro.

Anyone got any ideas?

Hey Dan,

It works fine.

The problem is that your pause is too short.

It's not just a matter of changing editor state. Toggling writes the Keyboard Maestro plist file, and that takes around a second.

If you manually toggle with a macro and try to run it quickly more than once it will fail.

In this one I'm not checking for state, since I already know what it is – I'm just toggling it.

Menu → Edit-Macro-Toggle.kmmacros (2.3 KB)

Try running that a couple of times real quick.



I have this question and don't know where to ask it — there are a number of posts where the issue of starting/stopping editing in the KM editor came up.

My KM editor is always in editing mode. Why would you want it not to be?

I agree completely.

Hey Mitchell,

To keep accidents from happening?;  :smile:

But I do that by keeping my test macro selected when I'm not working on something.

I too rarely ever leave editing mode.