Application switcher

Hi guys,

Quick question. Is there a way to reopen an app or bring it to the forefront when running cmd-tab. It would be so good if KM could force the app to reopen or force the window to come to the foreground.

Is there a way to do this or could this be added by the dev?

Many thanks

Hi,
you might use the macro Application Switcher, which you'll find in the Global Macro Group, There you have the option to include applications, that will always be shown.

1 Like

Hello. I think I didn't explain well enough. In the app switcher which you have an option that an app reloads or opens when I use the tab switcher, if it is not open or showing up. For some reason KM doesn't do that and I have lots of apps that I switch to via the application switcher that still do not open and I have to manually click on them.

Why not use a hotkey combination to use the action activate the app and bring it to the front?
I use CTL+CMD+Char and CTL+OPT+CMD+Char which covers all of the applications I use on a daily basis.

Not sure but I really love the way the application switcher works with cmd tab. It's just annoying that some apps dont play along.

Which apps? That'll give someone a chance to try and reproduce, then trouble-shoot, your problem.

Meanwhile, try removing and re-adding a problem app from the "Always include..." list in case an update or similar has broken a reference.

The main one I have a problem with is Soulver. Even when it's active it's not opening the window when selecting it from cmd tab.

Trial version of Soulver 3 is working fine here (macOS 14.5, KM 11.0.3).

If you've already removed and re-added it to the "Always include..." list, try again but using one of the other "Match by..." options at the bottom of the list:

image

Does it also work for you when you close the main window of Soulver and then switch to a different app and then try to go back to it via cmd tab?

By the way I also have the same issue with Apple Mail when I close the main window it will not open the app to the main window with cmd tab.

I'm no expert at this, but I think "apps" and "windows" are independent. Activating an app does not activate any of its windows. This is the philosophy behind macOS, and KM is respecting that philosophy. If you want an app to restore a window when the app is restored, you may require a macro to do that. For example, if you want Mail to open its main window when you restore Mail, (you said this app also had the same problem) then you can do that with a macro like this:

...or perhaps like this: (they are the same thing, CMD-0 is just the shortcut)

You will have to look in your app, probably under the Window menu, to see if there are any built-in ways to activate a window. If there are, you can modify my macros above to make them work like I have made them work. That may be all you need to fix this.

This isn't because KM is doing anything wrong. KM is just respecting the design of the macOS GUI and using the macOS APIs to let you do what macOS allows.

This won't be the only solution to your problem. There will be other solutions, some of which will involve AppelScript (assuming your app supports AppleScript) which can do even more than this, like opening up all the windows for a given app. But that's not what you wanted. You said you wanted the "main window" (at least for Mail.) For the other apps, and you didn't name all the apps, I'm not sure if you want the "main" window opened, or "all" the windows.

I suspect that Soulver (and most apps) will do what you want if you minimize the app without minimizing its windows. I don't have the app so I can't look into that. For example, in the apps I tested, CMD-H hides the whole app in such a way that when I CMD-Tab back to the app, the windows open. Even for Mail, the problem disappears when you work this way.

Yes, it activates Soulver.

Nor should it -- and this seems to be the same problem you are having with Soulver.

It is up to the application if it should create a new whatever window if activated with no window open -- nothing to do with the OS, nothing to do with KM. The Mac is not Windows, where closing the last window of an app exits the app -- we're allowed to have apps running without any windows open at all!

As @Airy says above, if you want this behaviour and the app doesn't provide it you'll have to roll it yourself. Note that KM's "Activate Application Switcher" is just another macro and you can easily add some logic to it, if you don't want to go @Airy's "activation macro" route. So you could do something like:

It really depends on what you want and how you work -- "activation macros" will work however you bring the app to the front while hacking the Application Switcher will only work there.

Since the problem seems to be limited to a couple of applications, e.g. Soulver, I refer back to my earlier post of using a hotkey combination to activate it.
I attach my VLC activate macro as it has the extra step of forcing the main window.
Note: It usually helps to have BOTH activate al windows and reopen initial windows checked.

This is awesome thank you so much. You are a star. I had a fiddle around and can now force it to open differently.