12

Is there a way to switch between windows by typing a portion of the target window's name? (like doing Spotlight search but for windows)

I frequently have many windows open, and CMD-Tab & friends, and graphical utilities like Witch really don't cut it.

I am looking for something analogous to the Emacs iswitch.

https://github.com/nate-parrott/Flashlight apparently used to do this (and much more) in prior versions of OSX.

1
  • I'd be surprised if there isn't an Alfred workflow that lets you do this... maybe somebody can point you at one, or even write one for you ;)
    – calum_b
    Jun 1, 2016 at 16:43

5 Answers 5

6

I tried grgarside's solution but his link timed out for me.

Ended up on Packal and found Swift Window Switcher

It only requires you to use it w name instead of window name and it also populates with Safari tabs. It, too, requires Accessibility permissions.

Still requires Alfred, which is paid, but it seems like the best solution I could find.

Alfred Searching for Chrome, returning this question as an open window

1
  • it is unfortunately too slow!
    – igor
    Jun 23, 2021 at 18:09
3

I implemented this functionality in a spoon for Hammerspoon. Fully open-source:

https://github.com/dmgerman/hs_select_window.spoon

Type the hotkey, then it will show you a list of all windows (except current), either in general or in the current application (one command each).

You can then select the window by typing a substring of the title or application and/or using arrows (or Ctrl+P, Ctrl+N)

It even works across workspaces and with full-screen windows.

1
  • Any thoughts on how you would use this for multiple virtual desktops? Or can we only call getWindows() on config load? May 25, 2022 at 3:04
2
+100

I was (am) looking for a simple, one-trick, open source solution. Still looking.

But I did find a closed-source app that does what I need: allows me to switch between windows by typing any part(s) of app and/or window name:

https://contexts.co/

Not free. Not open source, has to be allowed to "control your computer" via Accessibility features.

I also tried Alfred; it cannot do this out of the box (but a workflow could probably be created).

0

Switch window by name

Alfred workflow to switch to a window by the name of the window title. Uses Alfred's adaptive searching engine to make filtering really quick as it learns which windows you usually switch to.

Usage: window <search window titles>

You need to add Alfred to the list of apps allowed to control your computer in System Preferences → Security & Privacy → Accessibility. If you don't, it fails silently.

Download: https://georgegarside.com/resources/SwitchWindowByName.alfredworkflow
One day, I'll have a proper webpage for these workflows. Apologies for the direct download.

I did have it loading icons for the apps, but defaults takes too long to get the app icon. For something that's fast, waiting 1 second for it to load the icons takes too long, hence the uniform icon. At least it has the app name underneath!

Known bug: if a window title has the word "window" in it, stuff breaks! I've already spent hours on this workflow, sorry!

2
  • ... this requires typing "window" every time. I could probably live with typing "w" as the command. Maybe.
    – Dmitri
    Jun 3, 2016 at 3:31
  • @Dmitri The command is customisable to be ‘w’ or anything else, or you can use a hotkey. All these things are editable in the workflow.
    – grg
    Apr 5, 2017 at 18:35
0

You can install https://www.raycast.com, an alternative to Spotlight that allows switching windows by name.

I'd suggest assigning a hotkey to this command if you find yourself using it often.

Screenshot

2
  • Can you edit with some additional details? This is a bit thin and tough to understand how this answers the question.
    – Allan
    Apr 7 at 19:29
  • Sure @Allan. Hope it's better now. Apr 8 at 20:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .