Automating Window Management Across Spaces

I’ve been trying to use Bunch and Moom to launch apps and set the windows up the way I want them. I used Moom to store a snapshot of windows across multiple spaces. However, Moom seems to organize all the windows on the same space, not the space that they were on when I took the snapshot. Any other ways I may be able to automatically organize my windows on multiple spaces?

I just figured out that I can get the results I want, for the most part, using Mac’s ability to assign an app to a desktop. It just means a given app will always be assigned to a particular desktop or space.

I do the following.

Like you, I assign some applications to a specific desktop, I call these ‘anchor apps’.

I then open up the windows I want in a specific space, arrange them to my liking, and create a named Moom snapshot for each such space.

Then I set up a Bunch to open things. As finder windows cannot be assigned to a desktop I use a combination of keyboard shortcuts to switch spaces along with ‘anchor apps’ and then open the windows and any applications that are not assigned that I want in that space for this context.

I had to experiment with delays and item order in the Bunch to get everything to appear in the desired spaces, using Moom to ensure the desired arrangements. This paid off as I now have several Bunches that open apps and windows across my three monitors and ten spaces.

1 Like

This is what I was asking you about in the other forum.

It is possible to Use Bunch and Moom to control windows in multiple desktops/spaces (note that Apple uses both terms to refer to the same thing as different places).

The key point is to have Bunch move to the space/desktop you want the applications, files, and folders to be on, then open them, then have Moom arrange the windows. And then repeat for the next space/desktop. It will take some experimenting with delays in Bunch.

There are two ways to have an application open in a specific space (which you may already know).

  1. When an application is running, navigate to the space you want the application on, right click on the Dock icon, and in the menu select Options > Assign to This Desktop. And now when this application launches it will be placed on the specified desktop.
  2. In Bunch you can specify the space to open on but it requires some set up.
  • In System Settings > Keyboard > Keyboard navigation - Keyboard Shortcuts (button) > Mission Control > Mission Control (checkbox) – enable the “Switch to Desktop N” keyboard shortcuts for the N spaces/desktops you use.
  • In Bunch use the syntax {^N}, where N is the space/desktop to switch to. Then list the items to open on that space. Then trigger Moom to rearrange that space. Then move to the next space. You’ll need to experiment with the delays in Bunch to make things work.

Note that if you use method 1, then launching such an application in Bunch will switch to that space, and you can sequence the other apps for that space after this one, again experimenting with delays in Bunch.

I use these techniques in my set up, which has four monitors and ten spaces.

2 Likes

I can’t use this part of your method; the Keyboard Shortcuts for Mission Control are limited to 16 desktops and I currently have 45 — some are spares, there’s about 30 in active use, with names and hotkeys (hotkeys defined in a set of Keyboard Maestro macros). These are standard, Mission Control spaces, with standard numbers, 1 - 45.

When you say “use the syntax {^N}, where N is the space/desktop to switch to”, I presume you are using the default shortcuts, where ^0 would be Desktop 10 and ^⌥1 is Desktop 11. So to use Bunch to switch to Desktop 11 you would have {^⌥1} in your Bunch file, correct? I’m asking because I’ve never used Bunch and I’m wondering if Bunch could use the hotkeys that I’ve already defined in Keyboard Maestro to switch among my numerous desktops.

What I’m trying to solve is when I have 9 or 10 Preview windows open in various Desktops when I have to shut down. When I reboot, whenever I eventually activate Preview (e.g. opening a PDF) I get all 10 Preview windows open in the same Desktop, covering up all my other work in that Desktop. I don’t have a solution yet, but maybe Bunch could be part of it. I don’t see Moom being of much help in this particular case.

45 spaces! Zoinks.

The Bunch syntax {^0} sends the keystrokes “control 0" (sans quotation marks) and thus would switch to space 10. While the ^N where N ∈ {0 - 9} is handled by the Finder, I suspect that sending your Keyboard Maestro command using this syntax would work, but I’ve not tried it. There is an excellent Bunch manual here: Introducing Bunch - Bunch.app

To solve the Preview file opening on the correct screen in Bunch your do something like this (this is not the correct syntax):

  • switch to space N
  • open file at path with preview
  • switch to space N+/-x
  • open next file at path with preview

The thing I use Moom for is to move the window to where I want it on the desktop and on which monitor.

Hopefully this makes sense, please ask followup questions if anything isn’t clear. Bunch is free so I’d suggest to download it and see if it works for you.

1 Like