How Do I use the KM Action "Bring a Window to the Front"?

Hello everyone,

I am fairly new to KM and I wanted to test basic commands with the software to get familiar with.
I quickly got stopped with the command "Bring a Window to the Front" where I correctly named the window that I wanted to move in front (aka having that specific window to become the new active window for the next macro action). Unfortunately, the window change never occurs. The macro probably fails the command and moves on to the next one (which was a simple click at an absolute position).
I later tried another way which is to use (Mac)Command+Tab. Again, the macro failed to switch windows and KM continues with the next action.

I tried some troubleshooting with the interactive help. I added a trigger, checked the accessibility of the software. Nevertheless, the software was unable to find a mistake in the macro. Restarting either the software and the Mac did not help.
I added a picture of the macro below.

Can anyone help me please?

The action "Bring Window(s)...";
• is set to run after the click - move the action to above the click
• is deactivated - activate it
• is searching a window with "Safari" in the title - does the frontmost tab of Safari actually have "Safari" in the name? In Safari, the window name is based on the selected tab name. To verify the frontmost window name, click the WINDOW menu and look for which item has the check mark

Dear VDOCutter,

Thank you for your quick reply. My picture is rather confusing due to the multiple assays that I ran. Here is the explanation related to your points:

  • I put the click before because it was part of the first 2 actions: use Command+Tab and then press click

  • It is indeed deactivated because I tried both methods but they are not on 2 different macros, hence the deactivation to run separated tests

  • That is it, you are right; my mistake was to consider that Safari was the name of the window while the name was solely related to the tab name, which was completely different, thank you very much.

However, I still do not understand why the Command+Tab action does not work.

Hey @Tyrolio,

It works fine for me on my macOS 10.12.6 system with Keyboard Maestro 9.2.

Your macro is local to an app-specific macro group or global?

-Chris

Hi @ccstone,

I am unaware of this type of specificity. I would say that my macro is global. How do you determine your macro type?

You should read the quick-start on the wiki.

My Apple Mail macro group:

image

As you can see it's available only when Apple Mail is active (frontmost).

My main Global Macro group:

image

As you can see it's always active everywhere.

When you're working with macros you need to be sure they are enabled and active in the context you're running them.

You should also make certain sure your macro is firing with the given trigger.

When in doubt test with a notification action or a display text action to visually confirm the macro has run.

-Chris

I hope you don't mind that I have revised your topic title to better reflect the question you have asked.

FROM:
Failure to Switch Window Using Keyboard Maestro

TO:
How Do I use the KM Action "Bring a Window to the Front"?

This will greatly help you attract more experienced users to help solve your problem, and will help future readers find your question, and the solution.

Hey Chris,

Thanks for the tip. I had not checked before the macro groups parameter, which is another interesting component of the software.
All my test macros were stored in the general folder "All macros". I did not create a macro group to run my tests, thus I doubt that the problem is related to that. Nevertheless, my action "Type a Keystroke (Command+Tab) never worked, the macro keeps going with the next action. I wonder what might cause this.

Post the actual macro.

How to Post Your Macro to the Forum

-Chris