Jump to content

Window Navigator


Recommended Posts

Posted (edited)

What I was missing in the existing window switchers was a way to navigate between windows of the same application that are scattered across different desktop spaces, so I created one that does just that 😄

 

image.png.67e7bcb6aac7b71297fa68b6f937c54c.pngWindow Navigator


Navigate to any window of the currently focused application or any application across all desktops, or switch windows within the current desktop space.

 

GitHub-Download-000.svg?logo=github&logoColor=white

Usage

  1. Search the windows of the active app globally using the Navigator keyword.
  2. Search app windows in the current desktop space using the Switcher keyword.
  3. Search all visible windows of all apps globally using the Global keyword.
  • to navigate to the selected window. 
  • ⌘⏎ to close the selected window.
  • ⌥⏎ to quit the owning application.
  • Configure the hotkeys for quick access.

 

1. Navigator

preview_winnav-1.png

2. Switcher

preview_winnav-2.png

3. Global

preview_winnav-3.png

Edited by zeitlings
v1.3.0
Posted (edited)

Added a third option to navigate all visible windows of all apps globally over all desktop spaces

Edited by zeitlings
Posted

This workflow would be helpful. I installed and getting 

 

Code 133: WindowNavigator/WindowNavigator.swift:320: Fatal error: Unexpectedly found nil while unwrapping an Optional value

 

Using

Sonoma 14.4.1

Alfred 5.5 Build 2257

Posted

Curious. You can try the updated version now to see if the problem is fixed!

FYI, if you want the workflow to be more responsive, you can install the Xcode Command Line Tools to create and use a compiled version.

 

xcode-select --install

 

Posted
7 hours ago, zeitlings said:

Curious. You can try the updated version now to see if the problem is fixed!

FYI, if you want the workflow to be more responsive, you can install the Xcode Command Line Tools to create and use a compiled version.

 

xcode-select --install

 

Works good. thank you

Posted

Window Navigator v1.2.0

I successfully rewrote the program to rely solely on the Accessibility API 🎉

By removing all AppleScript components, the program is now more predictable, reliable, and faster.

 

Posted

Hey @dood,

 

I did some digging and found that Arc does some strange things: Each modal or popup seems to be created as a unique window. The same appears to happen when a "booster" is added or has been added - but this behavior is inconsistent. These are not valid windows, although their properties suggest otherwise, but fortunately most of those windows are unnamed. A small caveat is that sometimes the unnamed Arc windows could be considered valid, e.g. when opening the configuration of an extension.

 

Anyway, I've modified the code so that you now have to explicitly opt in to keep unnamed windows. This seems to catch most if not all of the invalid Arc windows.

Also note the new hidden environment variable to blacklist specific window names if necessary.

 

v1.3.0

  • Added configuration option to explicitly preserve or dismiss unnamed windows
  • Added hidden environment variable ignored_window_names to blacklist window names as an additional failsafe
    • Note: Enter the names as a comma separated list
Posted

Note that some apps, e.g. Reeder, only have one single unnamed window. So this change (haven’t tested, basing this on the description) may make that app disappear entirely.

Posted
17 minutes ago, vitor said:

Note that some apps, e.g. Reeder, only have one single unnamed window. So this change (haven’t tested, basing this on the description) may make that app disappear entirely.

 

Yeah, the solution is a trade-off. I've added the option to explicitly preserve unnamed windows to compensate for those cases. By default, these windows are hidden, but they can be made visible if necessary, at the risk of potentially mixing in other unwanted windows. Given that unnamed windows are the exception in my experience, I think this should be an adequate solution for most situations.

  • 5 weeks later...
Posted (edited)

@zeitlings - Loving this workflow, thank you for sharing!

 

Is it possible to add AlfredExtraPane.app support to get a window preview? Would love to drop my window switcher app. Thanks again!

Edited by jwrc
Posted (edited)
Quote

For you to be able to plug in @Mr Pennyworth's ExtraPane, all you need is a file path in the Quicklook preview, right?

 

Yup, that's right. ExtraPane should pick it up as long as quicklookurl is set to a path to an HTML file on disk or an https URL. I want to eventually add support for image files as well, but currently only html is supported.

Edited by Mr Pennyworth
Posted

This is an amazing workflow, thanks so much!

 

Apologies if this is an obvious one, but one issue I'm having is with the WindowManager completely dominating the wa command. Is there a way to exclude these results entirely?

 

 

Screenshot 2024-07-15 at 16.42.34.png

Posted

Hey @unfunfionn

In 1.3.0, I've added an environment variable to explicitly exclude specific window names (not entire apps though).

But from the looks of it, you should able to suppress the those (weirdly, also repeating and probably invalid) windows by entering App Icon Window, Gesture Blocking Overlay as the value of the ignored_window_names variable.

 

image.thumb.png.de1e488bb520e2a31185908b0cdb3336.png

  • 1 month later...
Posted

I just installed the workflow. It installs fine, but when I try to run it using WN or any of the other shortcuts it tell me that it is collecting windows. 
Then it just disappears.
If I then type the command 'wn' the workflow doesn't appear

 

Alfred version: 5.5 [2257]

Mac OS version: 14.6.1 (Sonoma)

Device: MacBook Air M1

Posted

I think I know what is the issue. When requested to provide window recording permissions I denied the option.

Is there a way to make it to work without giving recording permissions? It seems scary to provide those permissions which can be abused.

  • 1 month later...
Posted

Hi!

 

I'm on Mac OS 15.0 and I was trying to debug this and I found this:

 

error: 'CGWindowListCreateImage' is unavailable in macOS: Please use ScreenCaptureKit instead.
 

Are there plans to update Window Navigator to account for this?
 

Thanks!

Posted

Hey @Cccc

Thanks for reporting this. The already compiled versions still work on macOS 15. 

Let's hope there actually is a suitable replacement with ScreenCaptureKit - I didn't find anything on a first skim.

I'll look into it when I find the time.

Posted

This is a great workflow. Thank you.

How are the windows sorted in the result? I wonder if user can determine the sort, whether by app, by name or by last active?

  • 3 months later...
Posted

v2.0.0

  • Rewrite to compensate for the deprecation of CGWindowListCreateImage in macOS 15
    • Side-effect: Minimized windows are now also shown

The rewrite heavily relies on the Accessibility API. This results in a less performant version of the workflow, which is compensated with caching as much as possible. If you're already using a previous version of the workflow compiled before macOS 15, you can safely skip this update.

 

On 10/3/2024 at 11:07 AM, Belfong said:

How are the windows sorted in the result? I wonder if user can determine the sort, whether by app, by name or by last active?

 

There is no dedicated sorting in place, however, related windows are now clustered together. 

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...