"Windows with title containing" - only works with last-active window

I have 2 different fullscreen Chrome windows, they're on Desktop 2 and 3, named "ABC" and "XYZ".

I have 2 sets of "Bring windows with Name Containing" that either calls one or the other, thus changing the current desktop. This however only works with my last-active Chrome window, and not the other.

Hard to explain so I'll break down the steps:

  1. Manually go to Desktop 2 to activate "ABC" window
  2. Manually go to Desktop 1, activate Finder
  3. Trigger: Bring window named "ABC" to the front.
  4. SUCCESS: Goes to Desktop 2
  5. Manually go to Desktop 1 again
  6. Trigger: Bring window named "XYZ" to the front.
  7. ERROR "Manipulate window could not find any matching windows in macro "Trying"
    ...
  8. Manually go to Desktop 3 to activate "XYZ" window
  9. Manually go back to Desktop 1
  10. Trigger: Bring window named "XYZ" to the front
  11. SUCCESS: Goes to Desktop 3

But if I go back and trigger "ABC" - it gives the error again. So the Macro will only recognise the window-title of the last-activated window.

I thought it might be due to the windows being fullscreen, so I shrank them and put them inside Desktop 2, and tried the same procedure as before, triggering them from Desktop 1. Same results!

When I added a third Chrome window with "New Tab" for its title, and put that in Desktop 2 with the others, then neither ABC or XYZ got called, and returned the same "window not found" error.

Is this a limitation due to windows being on other Screens/Desktops? Are there any workarounds that achieve the result I'm looking for?

There is no API for Spaces/Desktops. And the window system chooses which windows to include in the window list, and how to behave as far as switching desktops when a window is activated.

So I'm afraid the behaviour of windows across Desktops is going to be “whatever Apple feels like doing” because Apple doesn't provide any public API to do otherwise.

You might take a look at @_jims' macro:

I'm not a Spaces user at all (if I can't see all my windows, I get lost :)), but if I were, his macro looks like it'd probably be a very useful tool. Note that I don't know if it helps with your particular needs or not, so you'd have to do some reading/testing to find out.

-rob.

1 Like