My default web browser is set to Switcheroo – a custom-made macOS app by Zhenyi Tan (with some feedback and guidance from me). Whenever I click on a link a modal of sorts appears letting me choose which Safari profile I’d like to load the link within.
Here is what that looks like.
When that tab loads the window it is in comes to the front. Actually, sometimes it does. Since I have so many profiles and more than a few tab groups in each, Switcheroo sometimes has trouble doing so. We’re still working on it. Feel free to lend a hand.
But, let’s imagine it worked.
Pretend I have an active Safari window, with my personal profile loaded, and the newly clicked link within it. And if I want to focus specifically on that one tab, I can use macOS’s “Hide Others” command (Command+Option+H) to hide all other apps except Safari. But that still leaves open the 3 other Safari profile windows I have loaded.
So I created a Shortcut that sort of works for this.
Using some AppleScript, I tell the current application (in this case Safari) to set all of its windows invisible except the frontmost one.
This works. All of my other Safari profile windows disappear and I’m able to focus on the active window. However, there is one caveat. All of the other windows aren’t “hidden” in macOS terms, they are actually invisible. They are no longer available to me even from Safari’s window list.
To rectify that, I have another Shortcut to restore all of the current application’s windows. Effectively, reversing what I’ve done.
I invoke both of these via the Menu Bar. Though I’ll likely set a keyboard shortcut for them soon.
This method could be much better. Here are just some random thoughts about how it can be improved.
- I currently use my Logitech MX Master 2S’s “middle click” button to invoke macOS’s “Hide Others” command. I wish I could call these Shortcuts with it as well. Can I?
- Setting “visible” to false isn’t exactly what I want. I’d like to hide the windows rather than make them disappear (a macOS nuance no doubt). But, I don’t think there is a way to do that with any application in macOS.
- I could see using some logic to combine these two Shortcuts into one.
Feel free to offer suggestions or code. 🙂
Leave a Reply