March 2022 Software of the Month Club: Bunch

The nominated March 2022 software of the month is Brett Terpstra’s Bunch:

What’s Bunch all about?

From the banner of the Bunch site

Bunch is a macOS automation tool that takes a folder of plain text files containing lists of apps and commands to launch and provides an easy-to-use menu for triggering them.

Its intuitive syntax makes it easy to get started, and its array of features allows you to automate everything you need to work smarter and faster. Build “contexts” of apps and settings for your different modes of work and play, and switch between them with a couple of keystrokes.

It’s just plain text, but with Bunch it’s a powerful automation tool.

What do Bunch files look like?

Bunch lives in the menubar of a macOS (not for Mobile devices, AFAIK). It executes commands found in a plain text file. Here’s an example of Bunch’s syntax, from the Bunch Samples

# Comments start with `#` or `//` and a space
# blank lines are ignored

/*
Comments can also use a block syntax
for multi-line comments
*/

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

/* Apps to launch start at the beginning of a line, no
need to quote or escape. */
Messages

# Apps launched by a Bunch can be quit when the Bunch is closed
%Terminal // Add a percent symbol to ignore it when quitting (keep it running)

/* Include a line starting with a dash to open specific
   files in the app.
   If the first file listed is "XX", all open windows
   for the app will be closed first */
Finder
- XX
- ~/Desktop
- ~/Documents
-> ~/Pictures // Opens Pictures in a tab of the Documents window

/*
Commands are surrounded by parenthesis. Only commands Bunch
recognizes will be executed
([hide|show] dock) -> Turn Dock autohiding on or off
([hide|show] desktop) -> Show or hide desktop icons
(dnd [on|off]) -> Turn Do Not Disturb on or off
*/
(show dock)

# Use a URL instead of an app to open it in your default browser
https://brettterpstra.com/projects

# You can also use URL schemes from other apps
x-marked://open?file=Work Stuff.md

# Start a line with an exclamation point to quit that app if it's running
!Mail

# Start a line with an asterisk (*) to execute as applescript
* say "Bunch launched"

/* Or run a shell script with a dollar sign ($)
   and set environment variables with "file" markers */
# $ /usr/local/scripts/myscript.sh arg1 arg2
# - KEY=value

/* Or an Automator Workflow with an ampersand (&)
   File markers will set variables for the workflow */
# & ~/Documents/My Workflow.workflow
# - key=val

/* Start a line with @ to "focus" that app (hide others)
   Focus commands should be the last item in the Bunch */
@Marked 2

# See the documentation for more info: https://bunchapp.co/docs

How are you using Bunch?

Are you using – or have you used – Bunch? If so, what are you using it for?

Do you have any favorite “Bunches” that you can share?

Has Bunch operated the way you expected – or what challenges have you had?

I use Bunch, and I currently have seven bunches defined. Although I doubt I’m a “power user”. And I’m sure others will comment on some of the more advanced features.

My current set up consists or four monitors and ten spaces and I use Bunch, along with other tools and settings, to set up applications, folders, and files across these monitors and spaces.

One of my hobbies is photography and I have two bunches related to that. One for image
ingestion and another for processing.

Here is my Photo Ingest Bunch:

---
title: 📸 Photo Ingest
---
# This is my photo ingesting context


# Switch to Space 9
{^9}

# Open Image Folders
%Finder

- /Volumes/Images/ Originals
- /Volumes/Workflow/DNGs
- /Volumes/FireCuda 2T/Camera Card
- /Volumes/FireCuda 2T/PM Ingested Images


# Apps to launch 
Adobe DNG Converter
Image Capture 

* tell application "Moom" to arrange windows according to snapshot "Image Ingest" ~5

Photo Mechanic Plus ~7


{^9} ~20

Here‘s what is going on:

  • The first thing that happens is {^9} switches to Space 9.
  • Then four folders open that I use to move images through my workflow.
  • Then two apps open in Space 9.
  • Then AppleScript is used to call Moom, which arranges everything in Space 9, there is a delay of 5 seconds (~5) to make sure everything has opened.
  • Then after another delay Photo Mechanic Plus opens. I have Photo Mechanic Plus assigned to Space 1, so it opens there.
  • It takes awhile for Photo Mechanic Plus to fully launch, so I wait 20 seconds and then switch back to Space 9 to start the process of copying the images form my camera.

I needed to experiment with the order things happen and the delays added to get everything to open in the correct space. But now it works for me.

I’m also learning SQL, and I have a Bunch that launches SQL tools and online references and tutorials. I like that I can easily change the items that open by simply editing a text file. For example, once a tutorial is completed I can replace it with a new URL (or comment the line if I want to save the reference).

There is extensive documentation and the developer, Brett Terpstra, is active in the Forums and has quickly responded to any questions I have had.

I find Bunch a useful tool for how I use my Mac. And look forward to seeing how others are using it.

4 Likes

Thank you @MevetS – that’s an interesting use case.

I have a very simple Bunch that merely launches 5 apps, which I use after logging into the MBP. The Bunch hangs with spinning beachball every time I use it. Even if I wait 5 minutes after login to attempt the bunch. It’s just easier to click the five icons in the Dock and away I go.

Have you or anyone encountered this behavior? It has stopped me from experimenting further with Bunch.

Thanks.

I did have the spinning beach back when I first started using Bunch. But I do not remember what the issue was or how I fixed it.

One thing you could try, and may already have, is to comment out the apps and turn them on one at a time to see if there is a specific app that causes the issue.

I do know that in System Preferences my settings for Bunch are:

Accessibility - √
Files and Folders - √ for Removable Volumes, Documents Folder, Desktop Folder.
Automation - √ for five applications: Finder, System Events, Moom, NeoFinder, Script Editor.

And in the Troubleshooting section of the Bunch docs it lists a few apps that do not work with Bunch. And there is a log you can check to see what may be causing the issue.

Good luck if you decide to try debugging the issue.

1 Like

hi @anon41602260 thanks for leading this month’s discussion.

From a use case perspective, just wondering how is the experience using Bunch versus shortcuts. I do not have experience on both. Just thinking whether I can do what Bunch is designed to do with nested shortcuts, may be not as elegant

Interesting question. I suspect that there are multiple ways to accomplish Context setup on a Mac, some methods easier than others based on the individual use cases and one’s familiarity with the tools.

I’ve not had a reason to use Shortcuts on my Mac, but this sounds like a fun exercise and a good excuse to try it out.

Can anyone suggest a good reference for getting started with Shortcuts on the Mac? Most of what I’ve found is targeted at iOS (although if it is the ‘same’ across platforms that might be ok?). Thanks in advance.


Ok, so I went ahead and created a Shortcut that is equivalent to my Photo Ingest Bunch.

It is not clear how to copy/paste a shortcut (is that possible?) so here is a screen shot:

I find the Bunch easier to read and follow what is being done. This is of course a personal preference and is in part due to my level of familiarity with each tool. I’ve been suing Bunch for some time now. This is my first Shortcut.

And I would appreciate if anyone can tell me the Shortcut commands to:

  1. Switch spaces.
  2. Open folders.

Note also that the first run of a Bunch launches the applications. The second run quits those applications (this can be overwritten). I do not see how to do that with one Shortcut.

For those familiar with ScreencastsOnline, the weeks tutorial is on Bunch. A great co incidence to watch a video of it.

5 Likes