Jump to content

Window Switcher — Switch to a specific window of an app in the current Desktop Space


Recommended Posts

Ah super interesting. I hadn’t thought about unnamed windows in that context. Regardless, I hope this was helpful. I’ve been using this workflow quite a bit lately and it has been very helpful for getting to 3 different finder windows I keep open for a project I’m working. 

Edited by sepulchra
Link to comment
  • 1 month later...

Hi, just found this workflow after having tried several window-swicher-apps that did not play well. This workflow is amazing. Thanks for maintaining it so well. Only question I have is if it is possible to also search for windows that have been hidden in Finder (CMD+H)?

Edited by defmc
Link to comment

Thank you for the kind words. It is not possible to search hidden windows because the API it uses only detects windows drawn to the screen. There are alternatives (the workflow previously used a different method), but they’re considerably slower and don’t preserve window stacking order.

Link to comment
4 minutes ago, samdale67 said:

could someone clarify that this app does not recognize minimized window?

 

It does not. See post right above yours:

 

On 7/2/2023 at 10:49 PM, vitor said:

It is not possible to search hidden windows because the API it uses only detects windows drawn to the screen. There are alternatives (the workflow previously used a different method), but they’re considerably slower and don’t preserve window stacking order.

 

That says “hidden” but it’s the exact same reason.

Link to comment
  • 4 weeks later...

Why hello! I bumped into the same limitation as mentioned in the previous comments, about hidden or minimised apps not appearing in the workflow results - but! after some exploration I came across a little macos utility called Tuck that helps to circumvent this issue. Tuck sends windows to the side out of sight at a keyboard shortcut, much like minimising them, but the OS still "draws" them even though they are not on display. And so they appear in the workflow results still!

 

The link, if you're interested, is https://www.irradiatedsoftware.com/tuck/.

 

Tuck (with which I have no affiliation at all) helps to make this workflow pretty much perfect now!

Link to comment
  • 4 weeks later...

Howdy Vitor,

 

Firstly thank you for this insanely helpful workflow. Such a superpower to add to Alfred! (Another superpower! 🦸‍♂️)

 

I assume the limitations preventing access to minimising windows might be the reason this isn't possible, but couldn't hurt to ask…

 

Is there any change this could be configured to find all open apps (even on different spaces?) or even those that are fullscreen?

 

Cheers, Nathan

Link to comment

Usually I’d be all for submitting such Feedback to Apple, and I’d even have a number you could duplicate in Feedback Assistant, but I doubt in this case it’s going to make a difference because Apple’s own tools work like that: In the Shortcuts app, add a “Find Windows” and tell it to find “All Windows”. Then run the Shortcut. You’ll only see the windows in the current Desktop too. But if you still want to open a report, you can mention the “Quartz Window Services”.

 

Unrelated to that, just pushed a new release (2023.5) which changes how unnamed windows are presented (now it’s the name of the app instead of “Unnamed”).

Link to comment
  • 2 weeks later...

Came here to praise Spotify Mini and discovered this workflow! Oh wow! It's so good, it might just sherlocked Witch, which is a tool I used to Alt-Tab into each open window. But Witch is slow. Alfred is FAST!

 

And, I can even show only Excel windows by "win excel" or "win preview" for PDFs! Excellent!

Or,

Ctrl-Alt-W (my hotkey) and type excel ... Thank you.

Edited by Belfong
Link to comment
On 8/30/2023 at 4:42 AM, Floating.Point said:

Howdy Vitor,

Is there any change this could be configured to find all open apps (even on different spaces?) or even those that are fullscreen?

 

Cheers, Nathan

@vitor thanks for this workflow. would like to find out if an additional keyword / option can be added to find all open apps on different spaces as well as full screen? It is similar to command+tab but with name search capability.  

Link to comment
1 hour ago, Floating.Point said:

 

Hey Tom unfortunately due to limitations with MacOS this is not currently possible

Thanks for your reply. It will be great to understand this better.

 

I thought AppleScript can be used to get list of all active applications easily. For example, code like this:

 

tell application "System Events" to ¬

set appBundleIdentifierList to ¬

the bundle identifier of ¬

(every process whose visible is true)

 

repeat with appBundleIdentifier in appBundleIdentifierList

try

tell application id appBundleIdentifier to ¬

set {appName, winCount} to {name, (count windows)}

log appName & ": " & winCount

on error errorMessage

log errorMessage

end try

end repeat

Link to comment

AppleScript is noticeably slower and it cannot guarantee window order. This workflow specifically moved away from it. It will also not show Safari (or any other browser) tabs, that is out of scope as it would drown relevant results (and again, be slow). There are other workflows which can do that, and there are Automation Tasks which return information on browser tabs which can both be used to get tabs and switch to them.

 

This workflow should be considered feature complete. It does what it sets out to do, and does it as fast as possible within the available constraints. I carefully weighted all pros and cons of every possibility and this is what it has landed on.
 

The workflow is still maintained: it will get bug fixes if any are found and updated to newer macOS versions if necessary. It may also get tweaks in behaviour if they are reasonably small and don’t affect the workflow as a whole. But what it does will not change unless new relevant possibilities are added to macOS.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...