Bunch, App Opening, and Window Activation

Hi Everyone,

After the (sort of) recent episodes featuring Jay Miller and Brett Terpstra (drink), I am giving Bunch another go for contextual workspace management. I love the simple, plain-language syntax of Bunch files and I like being able to just write out a script, rather than having to build a macro in Keyboard Maestro.

That being said, I’m running into an issue that I’m hoping someone here might be able to shed a light on.

My standard GTD Bunch hides all windows, opens a few apps, and rearranges their windows into my preferred pattern with Moom. However, I’ve found that the Bunch is very inconsistent. About 90% of the time, either not all of the apps are opened or, if they are already opened, new windows are not spawned (nor are currently-available windows activated).

Am I doing something wrong? Or, am I misinterpreting the use-case for Bunch? I’m copying the contents of that Bunch file below. I welcome any and all feedback. Thanks in advance!

---
title: GTD Bunch
---

# Hide everything
@@

# Launch GTD Apps
%Google Chrome
%Obsidian
%Spark
%Omnifocus
%iTerm
%Fantastical

# Focus on Obsidian
@Obsidian

# Wait 1 second.

(pause 1)

# Tell Moom to arrange windows.

* tell application "Moom" to arrange windows according to snapshot "GTD Setup"
1 Like

I’ve run into the same problems, so I’ve just stuck with Keyboard Maestro. I’d rather use Bunch for the reasons you state.

Instead of having % in front of every app, you may want to instead add only opens: true to your bunch header, I don’t know if that will fix the problem, but it might. Also, have you changed the preference to open apps simultaneously instead of sequentially? You may want to set sequence: true in your Bunch header to make sure that’s not a problem.

There’s also a section of the docs on activating apps, including if they are hidden which may be worth checking out.

Finally, the section below the one linked above explicitly says that focusing an app should be the last line in a file so after your AppleScript for Moom.

1 Like

Absolutely brilliant, @RosemaryOrchard. This bunch went from sour to sweet with literally two tweaks.

After posting yesterday, I had actually removed the focus command from the bunch, given that it wasn’t critical and I did realize, after the fact, that it was in the wrong spot. However, I totally overlooked the activation spec in the documentation:

To force an app to become foreground (and unhide if hidden), append a caret (^) to the app name.

Thank you so much for your input and help!

1 Like

I’m glad to have helped!

I guess I’m getting too old for this stuff. I’m trying for days to get a bunch working, but it doesn’t go the way I want. It is not a complicated task, so I’m not sure why it doesn’t work.

I want to open two websites in my browser (Firefox) and open Numbers. After that a Moom command is issued to put the browser on the left side of the screen and Numbers on the right side. What keeps happening is that there are two instances of Firefox being opened, one for each website, instead of one instance with two tabs. When the Moom command is issued only one of the browser windows is moved to the left and the other is left as it is.

Also after ending the workflow I’m not able to get Firefox back in it’s normal size.

This is the Bunch:

---
title: Shortwave listening
---

# Use @@ to hide all visible apps. Usually used at the top of the file
# before launching the rest of the bunch
@@


numbers 
-/Users/frank/Library/Mobile Documents/com~apple~CloudDocs/Radio/Radio log 2021.numbers

firefox
https://www.hfunderground.com/board/index.php 
https://www.short-wave.info/

safari:https://outlook.com

*  tell application "Moom" to arrange windows according to snapshot "FF en Numbers" ~2

#[On Close]
Firefox

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

I hope a more experienced Bunch user can help me.

I’m not a regular Firefox user so I’m not quite sure, there may be a setting to open new pages in a new tab rather than a new window.

If not, you can always simulate keyboard shortcuts in Bunch to open a new tab then enter your URL.

For Moom, it may be worth using a Waiting Snippet to only trigger Moom after all the apps have launched. This is done with 1 tab indent or 4 spaces at the beginning of your line. (In my experience I had to put Moom in an embedded snippet in order for this to work properly)

1 Like

Thanks, but that didn’t help either. So I’m going back to my old method, doing this with AppleScript. It’s a pity, because I thought that if i could move over several workflows I made in AppleScript to this I was more future proof. Maybe I try to do this with the new Siri Shortcuts in the next version of macOS, that’s also an option.