...then this macro will OCR the frontmost macro dialog (and not the rest of your screen(s)), extract the UUID, and open the macro in KM ready for editing:
You guys are awesome. Thanks for all of the time and clever ideas.
Agreed.
Duh. Using the keyboardmaestro:// URL Scheme. That's what I was trying to think of before. I think most user created ways of implementing this would rely on this.
What an interesting approach. I think I understand the logic of it but it will take me a while to fully wrap my mind around it.
Side note: It's nice to see that someone else was thinking along the same lines and not only took the time figure it out but also write it up. Thank you.
Wait. What!?! This is even more impressive. Thank you x2 !!
Amazing!
Even though, on its face, using OCR for something like this sounds nuts, it totally makes sense given the limitations you mentioned above. I also like how it will "fail gracefully" when the dialog has no UUID.
And very clever confining the OCR'ing to the dialogBounds.
TIL: [:xdigit:] in RegEx.
Once again, thank you everyone for your ideas and time.
I just realized that by turning off my email flag, apparently I don't get notifications when someone mentions my name like this in a thread. But I read a lot of threads and I found this reference independently. Let me read this thread and ponder it. It's quite flattering to get that comment from Nige.
Here's my first go, which seems to work in my test... (of course, I may not understand the question.) What this does, if you add a trigger to it, is that it uses OCR to read all the text in the frontmost window, then extracts all the links, then lets the user choose which link to open in their default app for links.
I was thinking about creating a macro that used either the Executing Macro or Executing Instance token to reference the macro that spawned the User Input or Alert.
But that's also not possible for the same reason as:
I know the manual way to deal with this would be to create a Go to: Macro with UI on-screen macro that has a bunch Open URL actions with kmtrigger://macro=UUID and accompanying if checks (or switch) to first see if those macros are currently executing.
But that's very... Manual
And even if it worked, there would still be downsides. Like: If different macro starts running after the one with the alert/user input, that one will open.
I keep coming back to these two approaches:
A new token can be used to open the calling macro.
For example: ExecutingMacroThatSpawnedThisUi (that is a horrible name) that would be used in conjunction with the Open URL action and kmtrigger://macro=UUID.
A new Go to macro ▶ menu item in the KM menu.
Its contents would be a list of the currently running macros. So essentially a version of the Cancel menu that would go to the selected macro rather than cancelling it.
And like I mentioned above, maybe it could be the alternate version of that Cancel menu, that appears when you hold down the option key.
I'm not sure the best way to handle assigning a keyboard shortcut thought, since: