Michael Buffington: iGTD + Quicksilver + subversion

In the last entry I put the emphasis on getting my tasks written down quickly and out of my focus into a system I could trust. I could choose to spend some time later to review my tasks and do what I like to call "iGTD gardening", where I check up on all my projects and do a bit of weeding of duplicate or irrelevant tasks, and fortify those tasks with whatever information comes to mind as I'm looking at them.

Since I'm now in the habit of pushing new tasks to iGTD and immediately forgetting about them I have the refreshing ability to work on a task without ever thinking about anything else. iGTD then becomes my set of instructions to follow when I need guidance, and if I've tended my task garden well, it's a rich set of instructions with a lot of tedious thinking already finished.

This system works out alarmingly well until you're possessed by SSD (severe stupidity disorder) and delete your iGTD database without even a whiff of lingering vapors. Immediately you'll be consumed by a profound and unshakable dread as you realize your tether has been severed from the mother ship and you begin to drift into outer space, your Tang to be divided up amongst your colleagues (even the ones you loathe).

Luckily for most of us, iGTD makes database backups upon starting up the iGTD app and for a couple of other events, and luckier still, most of us don't suffer from SSD very often.

But I often do, and don't leave anything to chance.

Rather than risk losing my entire brain to an episode of SSD I employ a SMP (scheme of massive paranoia). It might seem quite heavy handed, but I send a backup of my iGTD data to a subversion repository whenever the iGTD database changes. In a nutshell, it means I have a comprehensive history of every save ever done to my iGTD database, and am nearly assured that I'll be able to save myself from myself with only the smallest amount of data loss.

Now I'll be the first to admit that what we're about to look at is a bit Rube-Goldberg-esque, and I'll admit there's a certain joy in that as well.

A few things to know before we move on:

I'm doing this all on Tiger, which means I have both Ruby and sqlite3 installed out of the box.

Your paths to both Ruby and sqlite3 might differ from mine.

This code likely has bugs. I whipped it up in a few hours.

Also, worth noting - I'll be adding to this body of code as I move on with more blog posts about iGTD. What may look a bit like an empty shell now will get some more meat as we go along.

And finally (I promise), all the code I talk about in this series will be downloadable at some point.

Create some Ruby!

Create a file called iGTD.rb in /usr/local/lib/ruby (or /opt/local/lib/ruby if you're using the Macports version of Ruby like me).

That'll start off our iGtd library with something basic. It seems totally superfluous when you think about it, but remember, we'll be adding to this at a later date.

The newest version of iGTD (v. 1.4.5) comes with a command line utility that allows you to pass your task along the same way you push tasks into iGTD through the Quicksilver plugin. The above code simply wraps some Ruby around that command, executing it when we call it, which we'll come back to in a moment.

Now we're going to take advantage of a Quicksilver feature that you might not see documented many places - you can pass text to Ruby scripts saved as action in ~/Library/Application Support/Quicksilver/Actions. Up until recently I assumed you could only have AppleScript actions, but that's not the case.

Let's see some of that Action in action. Create a file called gtd.rb in ~/Library/Application Support/Quicksilver/Actions that looks like this:

!/opt/local/bin/ruby

require 'iGTD'
IGtd.capture ARGV.join(" ")

This script takes whatever commands are passed in, joins them back up as a single string, and hands them to the IGtd.capture method we wrote above. Note that we join the string back up because Ruby splits up command line arguments into an array wherever it sees a space. So we simply reverse that process by adding the spaces back in.

Make sure you make the file executable. chmod ug+x gtd.rb should do the trick.

Once that's saved you should be able to invoke Quicksilver, press period to invoke text mode, hit tab, then type gtd. Your gtd Ruby script should show up in the list (if it doesn't you might need to restart Quicksilver [CTRL-CMD-Q]).

Now, despite the fact that you're using your own Ruby based action instead of using the iGTD Quicksilver plugin, your task will end up in iGTD.

Neat, but we're missing the paranoia. Let's add subversion commits into the mix.

At this point I have to assume that you've managed to get your iGTD.sql file located at ~/Library/Application Support/iGTD into a subversion repository, hopefully offsite. I'm gambling on the fact that you have some knowledge of subversion if you have any desire to do this at all.

Because the iGTD.sql file is binary, we want to dump it as raw text to be a bit more efficient with subversion. subversion only keeps track of differences between revisions with ASCII files, but keeps entire copies of binary files (which might not seem like much, but for a file that's in the 60-80k range, 6000 changes can turn into a 500MB subversion repository).

Having the iGTD.sql as an ASCII dump helps increase portability as well. You can rely on simple text editors to see your data with an ASCII dump, and in the worst scenarios, viewing raw SQL statements can be quite comforting if the alternative is viewing nothing at all.

Let's add the following method to our iGTD library (note that when you see a ↵ symbol that what should normally be on a single line is wrapping to fit the page - make sure you fix those lines if you're copying and pasting):

Now, whenever you push tasks from Quicksilver to iGTD through our gtd.rb action, subversion will commit the changes. I've added the luxury of being notified by Growl when the commit happens. Pay special attention to the paths in the script and make sure you're pointing to the proper places.

With this in place, not only are my backups effortless, but they're comprehensive. And because my subversion repository is on a remote server, I can reconstruct my task list as long as I have a computer and an internet connection. Given enough time to think about it, I'd probably get paranoid about my subversion server keeling over too. Entertaining those thoughts to their final conclusion would require I hire stone carvers and buy a large granite mountain to chisel my lists, so at this point I'm content with the offsite backup.

This extreme paranoia with an admittedly heavy handed solution helps increase my trust level with iGTD, but it also opens the door to doing other automatic tasks whenever I enter a task through my custom gtd.rb file.

In the next entry in this series I'll show you how you can enter a task in iGTD once and have it travel to both Stikkit and Basecamp with a few additions to the iGTD Ruby library discussed here, and even grab new tasks from Stikkit.

Following that entry will be something I consider quite special - getting tasks into iGTD from your mobile phone through SMS. Assume the bullfighter's stance and repeat after me: ¡muy emocionante!

About the Author

Michael Buffington - A serial entrepreneur and creative technological consultant, Buffington most recently served as the Community Advocate for Values of N, makers of Stikkit and iwantsandy.com. He's now secretly building games for the masses.

43 Folders is powered by Drupal, which rules. The site was designed and made wonderful by the astounding Chris Glass. Ben Durbin is the sine qua non and our personal consigliere. 43f’s web hosting is sponsored by A2.