The upcoming OmniFocus 2 refresh provides more than ample reason for excitement. Forecast view? Updated review mode? The giddy feeling of firing up this morning’s sneaky-peek build to find yet another shiny new release ready for your eager paws? Check, check, check.
But unlike last time around1, OmniFocus 2 isn’t ready to take over my life yet, so for the moment I’m still usually working in OmniFocus 1. Every couple days I fire up OmniFocus 2 to kick the tires a little more and sometimes provide some (hopefully useful) feedback to the good folks at the Omni Group. (And yes, they’re listening.)
Unfortunately, switching fluidly between the two versions becomes problematic when you bring third party tools into the mix. Case in point: AppleScripts that tell application "OmniFocus"
expect that they’re working with an application called OmniFocus. So if OmniFocus 1 is called “OmniFocus 1” and OmniFocus 2 is called “OmniFocus”, your scripts will always invoke OmniFocus 2 until you rename the applications – even if you’re currently working in OmniFocus 1. That’s hardly ideal if you’re switching version with any regularity. And it was keeping me from using OmniFocus 2.
The solution? A script, of course! Here’s a script that automates the process of switching between primary versions of OmniFocus. This is what it does:
- Checks your applications folder for items matching the name OmniFocus* and asks you which version you’d like to bless2 [See the end for a version that skips this]
- Renames the blessed version to “OmniFocus.app”, and the other versions to “OmniFocus [version].app”
- Launches the blessed version
Here it is in action:
For those who enjoy reading detailed notes:
- If you choose the version that’s already blessed, that version will be activated and no renaming will occur.
- If OmniFocus (or many OmniFoci) is running when a the script is ready to rename, the script will handle quitting and relaunching for you.
- If you happen to have multiple copies that would have the same target name, only one will be renamed (i.e., files shouldn’t be randomly overwritten).
- While I built this workflow for the purpose of OmniFocus testing, it could work just as easily with any other application: just change the application name at the beginning of the script. You can also change the applications folder.
- If the script encounters an application without a version number in its metadata, it will be renamed according to its creation date.
- If you use the
tell application "System Events" to choose from list
line, the dialog will appear at the front (rather than possibly being buried behind windows). However, in my experience, System Events can hang, so I endure the less convenient version in order to keep things running quickly. - …and of course, your user account needs to have the proper permissions to rename the files.
I’ve been using this for about a month without issue, but of course use at your own risk and please let me know if you have any issues.
Grab the script here:
p.s…
Michael Schechter wondered about a version that blesses a specific version, rather than prompting for user input. This could be useful if you want to…
- Set up a Hazel rule or timed Keyboard Maestro action to automatically switch versions
- Keep two versions of the script for each version of the app to trigger by a launcher
So if you’d prefer a “headless” version, try this one.
- OmniFocus 1 replaced Ethan Schoonover’s exceptionally clever but ultimately hackish OmniOutliner scripts, Kinkless GTD, so it wasn’t long before OmniFocus quickly surpassed kGTD’s utility. But OmniFocus 1 is now a very mature product, so it may be some time before OmniFocus 2 can fill its shoes.↩
- Blimey, why the blessing? The name comes from a system command to choose which operating system to run on startup. The OS that’s set to run is “blessed”, and you select it by running the
bless
command.↩