Using Moom with Bunch for window management
One of the feature requests I get now and then for Bunch is to allow it to arrange windows. Some other batch launchers have this feature, but they usually have a GUI, and making that kind of thing work with plain text files is an ugly proposition. There is a good option, though.
Moom from Many Tricks is my window manager of choice. It does everything I need to do and does it elegantly. I know there are a few good options out there, but I’ve loved Moom and stuck with it for almost a decade now. One feature that stands out is the ability to store entire workspaces and call them back up by name using AppleScript.
Say you have a Bunch that launches multiple apps, and you find yourself spending time moving and resizing windows every time you load it. This is almost always true if you use multiple displays — most apps are bad at remembering their location, especially if the number of displays changes often. With Moom you can do all of your window arranging once, and then never again (until your preferences change).
Once you have everything where you like it, open the Moom menu and choose Save Window Layout Snapshot…. This will open the Moom preferences with a new “Arrange Windows” entry. Give this a unique title. You’ll probably want to turn off “Ignore obstructed windows” and click the Update Snapshot button. (By default only windows that are 100% visible have their position saved, but I usually have some windows overlapping.)
Note that you can use Update Snapshot any time you change your mind about a window location or add a new app/window to the mix.
Once you have the title set it’s easy to trigger the layout with AppleScript. The command is:
tell application "Moom" to arrange windows according to snapshot "snapshot name"
You can put this in your Bunch file as an AppleScript command that comes after all of the pertinent apps are launched. For example:
%nvUltra Audio Hijack Skype * tell application "Moom" to arrange windows according to snapshot "Podcasting"
You can create a snapshot for each of your Bunches, add the script line, and then forget about organizing your windows.
If you happen to know that this trick can be accomplished with other window managers, let me know and I’ll add a note for others who might be interested.