MACRO: Bring Custom HTML Prompt Windows to the Front

MACRO: Bring Custom HTML Prompt Windows to the Front

PURPOSE:

Have you ever been working on a Custom HTML Prompt, only to have it disapear behind other windows, and it can be a small PITA to uncover it?

Just launch this macro and it will uncover all KM Engine windows, including Custom HTML Prompt windows.

If you have multiple monitors, it works on KM Engine windows across all monitors.

However, if you use multiple desktops, this only works on the current desktop (in other words, it doesn't switch desktops).

Macro Code:

I'm not actually supplying the macro, because it's only one action long. In fact, it's only one line of AppleScript:

image

 
Here's the AppleScript code, which you can copy and paste into your own action:

tell application "Keyboard Maestro Engine" to activate

NOTE:

You can actually accomplish this with KM's native "Activate Application" action, but it takes a few steps that might not be obvious, because "Keyboard Maestro Engine" isn't in the popup menu:

image

 
Yes, "Keyboard Maestro" is in the list, but that's the Editor, not the Engine.

I'm not going to tell you how to get around this, because if you do it wrong, you could misplace the Keyboard Maestro Engine app, and that would suck.

But if you know what I'm talking about and don't mind living on the edge of danger, go for it.

image

 
Or just use the AppleScript. It's easier.


1 Like

Perhaps you've a trickier, more reliable, way to do this -- but can't you just make an alias to the KME.app then use the "Other:" option to bring up the standard "Open" dialog to navigate to and select it?

Probably. It's just that the KME app is inside the Keyboard Maestro package, and I don't like suggesting that people mess around in an application's package.

But, if that doesn't bother you, it's actually easier than you might think. Once you locate the Keyboard Maestro Engine app inside the package (using Finder), you can just drag it to the Editor, and drop it where you would insert a new action. It will automatically create an "Activate Application" action for it.

Of course, if you drop the KME app in the wrong place (if you have a finger flinch, for example, while dragging it), you can actually move it out of the package, "and that would be bad" (although a simple "undo" in Finder would fix that).

That's the bit that would worry me, especially over many repetitions, and it's much less likely to happen if you make an alias.

Of course, you only have to do it once -- Favou?rites, baby!

I'm pretty sure this isn't an issue in more recent macOS releases: In Sonoma, dragging the KM Engine app from the bundle (on my boot hard drive in the Applications folder) to the desktop (also on the boot drive) results in an alias on the desktop, and the KM Engine remaining safely in place.

-rob.

I hadn't thought about aliases. But still, you can see why I didn't mention it. :stuck_out_tongue: The AS works just fine.

I wonder if I should just remove the whole part of the OP that even mentions using the KM action. The only reason I put it in there was to answer the question before someone asked it, but maybe it's better without it.

What do you think?

While it's not immediately obvious to a reader how you'd set the action up -- "But KME isn't in my list of apps!" -- I think keep it.

  1. It's not that hard to set up, and you only to do it once then "Favourite" it
  2. It's considerably (8-10 times for me) faster than the AS method
  3. The intent of the KM action is marginally more obvious than the AS
  4. It's a useful reminder that the same can be done for other "embedded" apps
1 Like

All great points!

I was this close to just removing that section without asking, but now I'm glad I asked.

As we've mentioned more than once in the past couple of days, it's good to have outside suggestions.

Thanks!