Run Macro from macOS Dock

Back in 2014, Philippe wrote
"You can do it [Run Macro from macOS Dock] with AppleScript :

  1. At the top of your macro, click on “Or by script” and select “Or by AppleScript”.
  2. Copy the script that KM provides (you can then select “Or by script” again to close that box).
  3. Launch AppleScript Editor.app and create a new document if necessary.
  4. Paste what you copied from KM.
  5. Type Cmd-S and select “Application” in the File Format popup menu.
  6. Save the application where you want.
  7. Locate in a Finder window the application you just created, and drop it into the Dock.

Voila."

I found this older note and used it successfully to launch a macro from the macOS Dock. I want to do this because the net result is opening a document, then resizing and moving its window. I've gotten very used to opening this document from the dock.

This worked great, until it didn't. For some reason, every once in a while, the app created in Script Editor hangs up. I can force quit it, but then it doesn't work again.

A hot key always works.

I don't know what's going wrong.

You could also just export the macro as Trigger File and add that to the Dock.

(KM > File > Export as Trigger File)

1 Like

Thank you.
I'll try that.

...

So far, so good!