Are you ready? I kinda went down a rabbit hole with Bunch this last week. It’s a lot. Because this release is so big, I’m releasing it as a beta first. All of the documentation for the new version is at brettterpstra.com/bunch-beta/docs, and the download link can be found at brettterpstra.com/bunch-beta/download.

The documentation for everything here is fully updated (and expanded, as part of the aforementioned rabbit hole), and all of the pertinent pages are linked from the changelog. You can just skip there if you like.

First, the blame for this whole development cycle belongs partially to one Jake Bernstein. He had a couple ideas that I thought were pretty clever, and it was a slippery slope from there. Scheduled Bunches and Spotlight searches were mostly his fault. I’m far from blameless in this, but just I want him to share in the responsibility. Well, really I just wanted to give him credit.

Frontmatter

The first big thing is that I’ve introduced frontmatter. It’s YAML-esque formatting that lets you define attributes and variables at the top of your Bunch file. This means additional settings without further complicating the syntax. Just nice, readable keys and values.

---
title: 👍🏻My Cool Bunch
startup: true
---

First benefit: you can use a title key to define a display name that’s different from the filename. Which, of course, means that you can use emojis in your menu titles. A vanity feature, but I really like it.

You can define whether a Bunch launches at startup with the startup key, as an alternative to using startup scripts.

You can also define arbitrary keys and values that can then be referenced as variables in your snippets.

I know what you’re asking yourself at this point. “Did he really stop with just having static data at the top of a file?” No, of course not. Frontmatter can also be dynamically loaded from external files or shell script output.

So that’s nice and all, you say, but is there any real benefit to having frontmatter?

Scheduling

This leads to the second big deal: scheduling. In the frontmatter, you can define keys like open at and close after to open and close bunches at specific times, or on specific days, or even at repeating intervals. Have Bunches launch in the morning, close in the evening, or have a special Friday 9pm Bunch, for whatever nefarious things you do to kick off the weekend. Have a “Social” Bunch that only opens at set hours and automatically closes when your social media time is up1. You can even use open every to have Bunches that automatically re-open apps at specific intervals.

All of the keys work with natural language syntax. You can just write open at: 8:30am or open on: Friday 3pm. Interval keys take formats like open every: 1h30m.

The close after one has a nice ramification. You can use % before application names in the Bunch to avoid quitting them when the Bunch closes, but have all of the Bunch commands you ran be reversed after a set period of time. Things like Do Not Disturb, Dark Mode, or pausing Dropbox or BackBlaze can have automatic reset times.

See the docs for a list of available keys and more details.

Snippet Improvements

Snippets can now be set to run only when closing the Bunch:

!<useful.snippets#On Close Snippet

They can also be delayed just like apps and scripts:

<useful.snippets#Delayed Launch ~15

Delays work for on-close snippets as well.

Waiting Snippets

There’s also a new feature called Waiting Snippets that will delay running a snippet until all applications that the Bunch needs to launch or quit have finished launching (or quitting). Just indent by 4 spaces or 1 tab. Works with multiple snippets, and they can have additional delays that will begin once everything else is loaded.

Affinity Photo
Firefox
    <waiting.snippet#After Load
    <waiting.snippet#After Delay ~2

The above will wait until Affinity Photo and Safari have launched before starting a 2-second countdown to launching the waiting.snippet file. If all of the apps in the Bunch already match their target state when the Bunch is opened (i.e. apps to launch are already open, apps to quit are already closed), Bunch will open any Waiting Snippets after a short safety delay.

Embedded Snippets

With all of the features available to Snippets, you might want to take advantage of them without having to put everything into one or more additional files. If you just want to do something like having a script wait for everything else to launch and don’t need to reuse it in another Bunch, you can embed the snippet right into the Bunch. Just add three or more underscores at the end of the Bunch, and everything after that will be read as a snippet. Then you can reference the embedded snippets by using a second left angle bracket (<<) instead of a filename. Fragments, delays, Waiting, and on-close syntax all works the same.

<<#Embedded ~2
___
---[Embedded]
* say "That's pretty cool"

Pretty Section Dividers

Kind of an aside, but I loosened up the matching for Snippet section dividers so you can use any number of dashes or hashes before and after the square brackets that surround the section title. You just have to have at least one dash or hash at the beginning, and any that come after the brackets have to match the character at the start. So any of the following work now, whatever makes large snippet files look prettier to you:

-[My Section]
---[My Section]---------------------------------
##[My Section]##
##################[My Section]##################

(My own snippet files were getting large enough that the formatting was bothering me. This is just a vanity feature.)

Spotlight Searches

Where you would normally define files for an application to open, you can now insert a tag search or a full spotlight search, and the results will be opened in the specified app. For example, to open any PDF files you downloaded in the last day for review:

PDFpenPro
- 'kind:pdf date:today' [~/Downloads] !5

That searches for all PDFs dated today in your Downloads folder, limiting the max results to 5.

You can also do simple #tag searches. See the docs for details.

Default App

You can now use “Default” as an app name and any files listed under it will open in whatever app “owns” them on your system. This is especially pertinent with the Spotlight searches.

Default
- 'kind:document NOT tag:#' [~/Desktop] !15

The Bunch Log

As Bunch’s feature set grows, it’s getting more important that the user be able to see exactly what was happening when executing Bunches. So I added some logging features. Go to Help->Open Log and you’ll get a full view of Bunch in action. Set the logging level in the Help menu to get more or less information. Logs are automatically rotated.

A lot of Bunch’s error notifications have been moved from alert popups to notification center. Notifications that you have an error in your Bunch will also have a button that will take you directly to the log.

New Commands

(notify Here's a message) will send messages via Notification Center. Just make sure you have notifications enabled for Bunch in System Preferences.

(sleep) will sleep your Mac. (sleep display) and (sleep screensaver)… that seems pretty self explanatory.

Automation Integration

I’ve updated the docs with more details about tying Bunch together with great tools like BetterTouchTool, Keyboard Maestro, Hammerspoon, and more. See the Integration section to explore the possibilities.

I’ve also updated the Bunch CLI to handle running snippets, and included an interactive URL generator. Just run bunch -i and it will walk you through menus to perform any action that the URL handler has available.

New Support Forum

Of course, I’ve probably also introduced new bugs, so I’ve also set up a GitHub repository where you can report bugs or discuss ideas and ask questions. It also contains all of the documentation, and if you know how to submit a pull request, you can help out with corrections and additions.

I’m curious to know if using GitHub for this kind of thing works for people not usually on GitHub. If you find it inconvenient to get support this way, do let me know and I’ll make other arrangements.

Give It a Shot

Grab the beta at from the download page (where you can also find the current stable version). The beta has a different app name (Bunch Beta) so you can hang on to your current version while you test. And again, all of the documentation for the beta version is separate from the main site, so be sure you’re pointing to brettterpstra.com/bunch-beta/docs. (The Help menu in the Beta version will take you to the correct site.) Let me know what you think!

  1. This is theoretical. I would abhor any app that tried to tell me what to do and when to do it, even if I programmed it to do so. I only accept suggestions from my apps, not demands.