Hide Others - Except VLC _iff_ VLC is Floating on Top Macro (v9.0.6)

I’m not sure if anyone else will want to use this, but maybe once I explain what it does, someone will decide it is something they want too.

One of the things that I really like to do on my Mac (especially on my Mac mini which has a nice big screen) is watch videos while I’m doing something else.

99% of the time when I am watching video, I am doing so using VLC and watching video that I have downloaded using Downie (probably something from YouTube, but occasionally from somewhere else.)

I have VLC set up in a very specific way so that it does not show me anything except the video and (this is the important part!) I use a feature in VLC called “Float on Top”, which you can see here:

As you probably guessed, this keeps the video from being covered over by other applications, so I can always keep watching it, even when I switch apps. This is a great feature which I absolutely love and I think every video app on the Mac should have this feature.

But here’s the problem…

I have this… thing.

I guess it’s a personality “quirk”. Some might call it a flaw. Whatever you call it, here is how it manifests in my life and Mac usage.

I will be switching between apps, and end up with a lot of overlapping windows visible, but then I decide to focus on something, and I don’t want to see those other windows anymore. So what do I do? I press one of my favorite keyboard shortcuts on the Mac: ⌥ ⌘ H

As you almost certainly already know, ⌥ ⌘ H does “Hide Others” meaning that it will hide all of the other applications except for the front-most one that I am currently using. This is a great feature that I would literally pay extra for if Apple decided to remove it from macOS.

But as you’ve no doubt figured out already, the problem with “Hide Others” is that it also hides VLC, and I don’t want that if-and-only-if I am using VLC’s “Float on Top” mode.

That’s where this macro comes in.

I have remapped ⌥ ⌘ H (because I press that keyboard shortcut subconsciously, so obviously I can't use a different one).

Here's what happens when you press ⌥ ⌘ H when this macro is active:

  1. It checks to see if VLC is running. If VLC is not running, the macro just does “Hide Others”. Because obviously.

  2. It checks to see if VLC is the front-most application. If so, then it just does “Hide Others” because if VLC is already at the front, then it won’t hide the video that I’m watching.

  3. If VLC is running but is not at the front, the macro will quickly switch to VLC to see if “Float on Top” is enabled.

  • if no, it will switch back to the original app, and then just do “Hide Others” which will hide VLC, which is OK because I wasn’t watching it anyway.

  • if yes, it will hide all of the other apps and then unhide the original app that I was using. This has the net effect of leaving VLC’s window visible, but all of the other windows have been hidden.

There are a few provisos, a couple of quid pro quos.

  1. If VLC does hide all of the “other apps” it will necessarily hide the app that I was just using, and then unhide it. This creates a momentary “flicker” as the app hides and then unhides. I can live with it, but I will admit that it is a little annoying.

  2. Also, if VLC is not floating, I found that I needed to introduce a 1-second delay after activating the original application and before hiding the other apps. I’m not sure why, but if I did not, VLC was always visible in the background, even when “Float on Top” was not in use. Again, this is slightly annoying, but I will live with it, unless someone figures out how to keep that from happening.

Without further ado, here is the macro…

I hope you enjoy. Let me know if you have questions/problems/issues with it.

Hide Others - Except VLC iff VLC is Floating on Top Macro (v9.0.6)

Hide Others - Except VLC iff VLC is Floating on Top.kmmacros (41 KB)

Note that APPLICATION in all caps is how Keyboard Maestro designates the menu specific to each app which has that app's name, which is where the Hide/Hide Others menu items are.

1 Like