I made such a huge improvement to the “Bunches” LaunchBar action that I had to bump it straight up to version 2.0. Bunch has been improving, so this little one has to keep up. It’s the way of the world.
The action previously just read your Bunches folder and launched them with the URL handler. The URL handler has expanded, though, and there was a bunch1 of stuff I wanted to be able to do from LaunchBar. I actually use Bunch as much from my launcher as my Dock now, so it was worthwhile to put some time into it. Here’s what’s new:
Caching preferences retrieved from
defaults readto speed things up
Using defaults to determine the Bunches folder and the Toggle Bunches preference every time the action was selected was adding 2-4 seconds of delay. I changed it to read the preference plist directly, which cut down the domain search time, but it was still consistently slow. Those preferences aren’t likely to change all that often, so now it just caches them in the actions’ own preferences and only has a short delay once every few days when it refreshes.
The cache is set to last for 3 days at a time, and you can force a refresh from the settings submenu.
Allow setting a default action (Toggle, Open) that overrides your Bunch preferences
When Toggle Bunches is enabled in Bunch, the Dock shows checkmarks next to open Bunches and it makes sense to have the preference there. From LaunchBar, though, I don’t have access to the list of what’s currently launched, so it makes more sense to set the Action to default to “Open”. If you open the settings menu (the last item when you arrow into the Bunches action), you’ll see the item that overrides that preference.
Bonus: once you’ve set that, you’ll never suffer from that particular
defaults readdelay again.
- Every Bunch listed now has a child menu that offers whichever actions aren’t default If the default action is Open or Close, hitting the right arrow (or Ctrl-L) will offer you the opposite option. If it’s on Toggle, the options will include both Open and Close.
- Holding modifier keys when opening the action changes the default methods for that run
- Ctrl: close bunches
- Command: toggle bunches
- Shift: open bunches
After you type
bunchto select the Bunches action, hold down the Ctrl key as you arrow into it. Everything will default to Close. It’s handy once you memorize the keys. Or maybe I’m just too keyboard-nerdy.
Bunches can now accept strings
If you press Spacebar when the action is selected, Bunches will accept a string and execute it using the
raw?txt=method of the URL handler.
You could just run
(dnd off)to toggle Do Not Disturb. You can pass a longer string with more commands, but note that you need newlines between each command, so typing them in LaunchBar is not feasible. But…
Bunches can now accept files, too
You can select a Bunch file (with or without
.bunchextension) from anywhere on your system and hit tab to execute it in Bunch. Using this method will always run them with the
raw?file=method, which means they’re always going to open, even if you hand it a Bunch that’s in your main Bunch folder and already running. It treats all received files as “outsiders,” which is what the method was intended for.
- I made some new icons. I’ll hate them by tomorrow, I always do
If you’re wondering about the CLI, the only thing I’d really like to fix there is the same
defaults read delay. I updated the gist with the read-directly-from-plist modification, but it could still stand some caching. I’d also like it to accept text from STDIN for
raw?txt= handling, and files as arguments for
In the meantime, the LaunchBar action is packed, codesigned, and ready to go. Download below!
Bunches LaunchBar Action v2.0.1