Back in 2014, Philippe wrote
"You can do it [Run Macro from macOS Dock] with AppleScript :
- At the top of your macro, click on “Or by script” and select “Or by AppleScript”.
- Copy the script that KM provides (you can then select “Or by script” again to close that box).
- Launch AppleScript Editor.app and create a new document if necessary.
- Paste what you copied from KM.
- Type Cmd-S and select “Application” in the File Format popup menu.
- Save the application where you want.
- 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.