Inert Detritus The Internet's dust bunnies

1 September 2009 @ 11pm

Switching databases with Things

[Sep­tem­ber 1st: updat­ed for Things 1.2. See bot­tom sec­tion for details.]

I use Things for man­ag­ing tasks at work, and for track­ing my per­son­al to-do list. I did­n’t want to mix the two up, how­ev­er, so I use two Things libraries.

To swap libraries, you need to hold down option at pro­gram launch, and choose your oth­er library. But, since this is OS X, defaults read and defaults write can help us auto­mate this process a bit: Cul­tured Code is sim­ply sav­ing the path to the file in their preferences.

I wrote a small perl script to tog­gle between my two libraries, and it’s avail­able here. Save that to, chmod u+x it, and save it some­where in your PATH (I per­son­al­ly pre­fer ~/bin). You’ll need to change "/PathTwo" to your oth­er library loca­tion, and my $USERNAME = ''; to some­thing useful.

I was unable to open -a from with­in the script, so my shell alias to quit Things, swap libraries, and relaunch the app is alias && open -a

As of Things 1.2, I was get­ting an “Upgrad­ing Things library” dia­log on each swap-and-launch cycle. Cul­tured Code added anoth­er prop­er­ty list key, “Spot­lightIn­dexedLi­brary­PathKey”, which needs to be updat­ed once both your libraries have been con­vert­ed for Spot­light index­ing. Adding anoth­er defaults write inside the if() blocks in the perl script to write that key as well took care of it for me.