A Hotkey to Repeat the Last Macro Used?

Yes, it is possible, but may I ask why you want this? Why not just use the same trigger you just used to cut a line?

There are many issues to overcome to do this properly. @Yu_Cai has listed some some of them. One key issue is proper Macro Activation. It is easy to restrict the original macro to a specific app (or group of apps) using the Macro Group activation criteria. But the "Rerun" macro would need global access, and this could lead to running the original in an app where it should not be used.

Having said that, here is some untested pseudo code that you might use:

  1. In every macro that you want to use in the "Rerun" macro, set a KM global variable (say "DND__Last_Run_Macro_UUID") to the UUID of that macro using the "%ExecutingMacroUUID%" token.
  2. In the "Rerun" macro, run this AppleScript:
tell application "Keyboard Maestro Engine"
  set macroUUID to getvariable "DND__Last_Run_Macro_UUID"
  do script macroUUID
end tell
1 Like