Use a hotkey to switch back and forth between the two most recently-used macros. It is the equivalent of clicking the "Clock" icon in the editor (in fact, that's what this does).
I assign this to ^Tab.
NOTE: I published a version of this previously, but it contained functionality that is no longer needed, so I thought I'd publish a simplified version.
Here's the AppleScript, because this is all you really need.
tell application "System Events"
tell process "Keyboard Maestro"
perform action "AXPress" of button 1 of group 5 of window "Keyboard Maestro Editor"
end tell
end tell
I don’t have anything already done. Perhaps @ccstone?
Thinking about how I would design such a thing leads me to this question: How would the macro know which tabs to toggle between? I mean, the current tab, obviously, but what tab do you switch to?
The first time you run the macro it records the current tab as the LastTab, and sets GotoTab to null (or empty string).
Each subsequent time you trigger the macro, it set the GotoTab to LastTab, and then LastTab to the current tab.
If GoToTab is null OR not found, then notify user to manually move to new Tab.
ELSE activate GoToTab
All that is just off the top of my head.
I'm sure I can write a macro to do this, but I just thought I'd check first to see if someone else had already done it.
@DanThomas, I have really enjoyed using your above Toggle Macros, and Chris' Display Recent Edit menu/Recent Run menu with a pair of macros triggered by my TrackBall FWD/BACK buttons. After a little my real-world use/testing, I'll publish these macros.
2021-07-25 22:36:52 Execute an AppleScript failed with script error: text-script:64:153: execution error: System Events got an error: Can’t get window "Keyboard Maestro Editor" of process "Keyboard Maestro". (-1728)
So, although I know very little about AppleScript, I tried to edit the AppleScript. I made it to work at my 2nd try!!!
tell application "System Events"
tell process "Keyboard Maestro"
perform (action "AXPress" of button 1 of group 5 of the front window)
end tell
end tell
Awesome! But it was probably wasted effort on your part (other than a learning experience), because this "toggle" function and saving the position is now handled by KM natively, so you shouldn't need this macro anymore.