Using a Trigger to Open/Raise Submerged Finder windows

I'm a total newbie to Keyboard Maestro. Have to confess the Editor's interface still baffles me at times.

Using a MacBook Pro M1 running MacOS Sonoma 14.2.1 and Keyboard Maestro 11.0.2. Also using PathFinder 2166 (don't know if it matters). All pretty current for February 2024.

I've managed to setup some simple macros that use hot-key triggers to accomplish some simple tasks.

But I am totally stuck with a slightly more complicated aim. What I want to do is this:

  1. Use hot-key combo control-option-command-space as the trigger
  2. Have the trigger work at all times on the system (not disabled under any usual circumstances)
  3. I know that "Finder" is always working, but does not always have a window open
  4. If Finder has no windows open, simulate option-command-space, which should open an new empty Finder search window
  5. If there are (1 or more) Finder windows open, bring them all to the front--whether they are at the front or at the back or mixed

I've taken several approaches to start a macro in the editor, but each time seem somehow to end up with (as shown in the attached clip) a trigger that only fires "when finder is at front", and doesn't fire when finder does not have an active (up front) window.

The enclosed seems to work--but not when finder is not front/active:

Bring Finder Window(s) to Front.kmmacros (3.3 KB)

I've tried using the interactive help, but didn't really diagnose my shortfall. Is anybody willing/able to educate me?

Thanks,

--RK

This seems to work for me -

  1. The Group the Macro is in needs to be "Available in all applications" so that the trigger will fire the Macro no matter what App you are in when you press the hotkey.
    image

  2. You can add in an "Activate Application" Action to bring the Finder to the front just before your AppleScript.

Bring Finder Window(s) to Front v2.00.kmmacros (3.5 KB)

Click to Show Image of Macro

1 Like

Thanks for your answer....and so quickly too! It fixed my problem--and, more importantly, uncovered another blind spot in my understanding of the crags of Keyboard Maestro.

Solved the problem.

--RK