How can I instantly create a new macro in the same macro group with existing macros of currently active macro

I use a KM macro called Test to prototype my macros before I go on & create them.

I want to solve the issue of making the final macro ready for use when I am happy with how my Test macro looks.

Is it possible to go from this state in KM.

To this:

With all actions transferred & with focus on the name so I can fill it in.

Additionally it would be awesome if the Test macro would be cleared from the actions so it is empty.

Would be super grateful for such macro. :orange_heart:

I have a similar need, but use a different approach for solving it.

  1. Create a new Macro in the proper Macro Group, but append "@TEST" to the Macro name
  2. I have a Smart Macro Group whose criteria is "@TEST" in the Macro name.
  3. When finished testing, all I have to do is remove "@TEST" from the Name
    • I suppose you could write a Macro that does this, but it doesn't seem worth it to me.


Unfortunately your approach won't work for me.

I want to use my one Test macro way as I have a macro to instantly go to the Test macro so I can start instantly editing it:

And a way to run the macro instantly with Karabiner for rapid prototyping.

Only missing piece is the above translation of Test macro to a new global macro.

You could do it with AppleScript, but this sequence works and is easily automatable:

View ➤ Select Macro Column
Edit ➤ Duplicate
(title is automatically selected)

To remove all actions from an existing fixed macro, an AppleScript is the easiest solution:

tell application "Keyboard Maestro"
	delete every action of macro id "155F59EA-A4AD-4439-853A-61084ED33E9F"
end tell
1 Like

This will do the job, but, IMO, is highly risky. It could lead to deletion of all actions of a macro that you were not able to copy for some reason. Then, there is no easy recovery, especially if you just made changes, that would not be in the "Revert Macros" option.

I would not use this procedure, but if I did, before I deleted all of the actions, I would save/export the macro to file. You could use this macro to do that:

MACRO: Export (Save) Selected Macro

Undo will undo this change.

But Undo will not work once you have quit the KM Editor.

True. But fortunately I never quit the editor :slight_smile:

Thanks @peternlewis. It works wonderfully well!