Continue Discussion 20 replies
January 2024

bocciaman

Can anyone tell me if Moom can manage Desktop/spaces?

January 2024

ttscoff BrettTerpstra.com Supporter

Desktops yes, Spaces no. I’ve never seen an app that can control Spaces.

February 2024

MevetS

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.

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.

February 2024

bocciaman

Shouldn’t - {^7} tell Bunch to open apps in desktop 7? Then the Moom AppleScript will arrange the windows of the open apps?

I’ve setup desktop shortcuts

Here is how my Bunch file looks:

- {^7}
Numi.app ~4
Skype.app ~4
* tell application "Moom" to arrange windows according to snapshot "Space7"

Also, this is just an example, I know Skype should never be on a system in 2024.

2 replies
February 2024 ▶ bocciaman

MevetS

Using the “- {^N}” syntax sends the keystrokes to the preceding application.

However, since ^N is a global hotkey combination, you can remove the “-” and just use {^N}.

Reference: Keystrokes - Bunch.app

1 reply
February 2024 ▶ MevetS

bocciaman

I tried it both ways and I still got this message from Moom:

CleanShot 2024-02-02 at 11.56.43

Because Bunch wants to open everything in the current desktop. These commands: - {^7} nor {^7} didn’t register with it.

1 reply
February 2024 ▶ bocciaman

MevetS

Here is a simple example that works just fine for me.

---
title: Test Bunch
---
# Test Bed for Bunch Ideas

{^7}
PCalc

* tell application "Moom" to arrange windows according to snapshot "Bunch Test" ~2

{^1} ~5
CotEditor ~10

* tell application "Moom" to arrange windows according to snapshot "Bunch Test Two" ~20


* say "good morning Steve"

Note the delays. I had to experiment a bit to get it to work.

February 2024

MevetS

The possible issue here is that Moom is being invoked before the applications are launched. Put a delay on this line so that it happens after the last of the applications is launched.

1 reply
February 2024 ▶ MevetS

bocciaman

I tried until I couldn’t try anymore.

The Moving into numbered space just wasn’t consistent with bunch or moom. The apps either opened in the last space or stated in the original space where the bunch was launched from.

Here is a screenshot of my last attempt both apps ended up on top of each other on Desktop1.

---
title: Test Bunch
toggles: false
---
# Test Bed for Bad Bunch Ideas
 
{^7}
- (pause 5)
Numi.app ~5

* tell application "Moom" to arrange windows according to snapshot "Space7" ~30

{^8} ~2
- (pause 5)
Skype.app ~5

* tell application "Moom" to arrange windows according to snapshot "Space8" ~30


* say "good morning A.B."

The name script was the one thing that always worked.

3 replies
February 2024 ▶ bocciaman

MevetS

Hmm …

Are the keyboard shortcuts to move to different spaces working from the Finder? If yes, then the issue is with the bunch file. If not, then that is where the problem lies.

With respect to the Bunch file, it is not clear why the “pause” is needed after moving to either space. Nor why you are pausing the open of Numi.

If you are still interesting in troubleshooting, try building the bunch file up one line at a time. Of course you may have already tried this. But it not, comment everything out except the {^7} line, run the bunch, and see if focus switcheds to space 7. If yes, then add the “Numi.app” line without the 5 second delay, and watch how long it takes Numi to launch (if Numi launches before the switch, then add a delay to Numi). If this works then add back the Moom line, with a delay slightly longer than it takes Numi to launch.

Continuing, the add back the {^8} line with a delay long enough to allow all of the prior steps to complete. That is, don’t switch to space 8 until after Moom has arranged the windows. Continue to add back lines adjusting the delays so that each subsequent step happens after all the prior steps have completed.

If you look at my sample Bunch, each delay is larger than the prior delay.


Other things you can check.

I hope this helps. And let us know how you make out.

1 reply
February 2024 ▶ bocciaman

ttscoff BrettTerpstra.com Supporter

One thing to check would be whether you have your Bunches executing in parallel or sequentially. You can force this for any given Bunch by including the followin in frontmatter:

sequence: sequential

That would make sure that everything was launching in order and the delays were actually affecting the next open application. The implementation isn’t perfect, but sequential execution would be far preferable for a Bunch like this.

Also curious if you’re intending to use both ~X and - (pause X) at the same time. The ~X delays could just be increased to avoid the - (pause) commands in these cases.

Not that any of that will necessarily solve your issue, Spaces are very difficult to work with in general.

2 replies
February 2024 ▶ bocciaman

MevetS

I changed my test Buch to match yours:

---
title: Test Bunch
---
# Test Bed for Bunch Ideas

{^7}
- (pause 5)
PCalc ~5

* tell application "Moom" to arrange windows according to snapshot "Bunch Test" ~30

{^8} ~2
- (pause 5)
CotEditor ~5

* tell application "Moom" to arrange windows according to snapshot "Bunch Test Two" ~30


* say "good morning Steve"

And obtained the following results.

Removing both pause commands gave the following results:

As far as I can tell this is what is happening, in the ‘no pauses version’.

Also note that Moom cannot reach across spaces. So it only ‘sees’ windows in the space that has focus. Thus having both Moom commands on a 30 second delay means that they will both execute on whichever space as focus after the 30 second delay. To make it work as you want, you’ll need to ensure that the appropriate Moom command executes while the desired space still has focus.

February 2024 ▶ MevetS

bocciaman

No, Skype and Numi are off and “Rearrange spaces based on most recent use” is off as well.

mission control

February 2024

bocciaman

I thought I tried this as well, but I’ll try it again and report back.

February 2024 ▶ ttscoff

bocciaman

I added sequence: sequential but it seemed “to me” that it did the last line first. Both apps ended up on space 7.

---
title: Test Bunch
toggles: false
sequence: sequential
---
# Test Bed for Bunch Ideas
{^7}
Numi.app ~5

* tell application "Moom" to arrange windows according to snapshot "Space7" ~15

{^8} ~20
Skype.app ~5

* tell application "Moom" to arrange windows according to snapshot "Space8" ~35

* say "good morning A.B."
2 replies
February 2024 ▶ bocciaman

MevetS

You are telling both apps to open after a 5 second delay, Thus Skype is launched well before the command to switch to space 8.

Change this line, “Skype.app ~5” to “Skype.app ~25”.

1 reply
February 2024

bocciaman

I removed Skype and it seemed to work. I’ll try your suggestion as well.

February 2024

bocciaman

Success! I finally got it to work.

---
title: Test Bunch
toggles: false
sequence: sequential
---
# Test Bed for Bunch Ideas
{^7}
Numi.app ~5

* tell application "Moom" to arrange windows according to snapshot "Space7" ~20

{^8} ~45
Skype.app ~50

* tell application "Moom" to arrange windows according to snapshot "Space8" ~60

* say "good morning A.B." ~75

1 reply
February 2024 ▶ bocciaman

ttscoff BrettTerpstra.com Supporter

You had to use a 75-second wait to make it work? That’s awful.

1 reply
February 2024 ▶ ttscoff

bocciaman

It wasn’t that bad and what I posted here was just a test Bunch.