06.27.06

GTDAlt and Quicksilver, finally together!

Posted in TextMate, GTD at 10:15 am by Haris

The GTDALT bundle now contains a script that processes an “Inbox file” for actions, and distributes them to appropriate places. The purpose of this script is to be used in conjunction with a program like Quicksilver. You use Quicksilver to append such lines to the inbox as described here. Then when you are ready to review things, you run the script. The script has not been tested extensively, so be careful the first couple of times you use it. It keeps backups, so theoretically you would not lose data.

The following is from the help file INBOX.txt from within the bundle.

The Inbox file consists of lines of the form:

@context action name >project name @context another action

Here context and project name need not be matching the exact context of project name, but they each need to be full substrings of a unique item. In the absence of a project name, the action is added as a stand-alone action in a file with extension temp.gtd. If the context does not match any substring of an existing context, then a new context is created.

The script attempts to find a unique place for each such line, and if it does so then it removes the line from the inbox and adds it at the appropriate place. At the end, it presents you with a log of the actions that took place.

Note: I have taken some care to guarantee that no data loss results as a consequence of running this script. But please, take care to double-check the first couple of runs of the program, to make sure items go to the appropriate locations.

The script, in order to replace the old “.gtd” files, takes the following steps, stopping if at any point it encounters a system error:

  1. Writes the entire contents of the desired new file to files with the same name and extension “.gtd~~”
  2. Writes the new inbox file adding “~~” to the extension.
  3. Renames the old “.gtd” files so that they have extension “.gtd~”.
  4. Renames the old inbox file adding “~” to the extension.
  5. Renames the new “.gtd~~” files so that they have extension “.gtd”.
  6. Renames the new inbox file so that it doesn’t have the “~~”.

So if the script fails at some point, you know where to look, and at the end of the day you end up with backups as “.gtd~”.

In order to use the script, you need to do some work first, namely to set two environment variables:

  1. A variable named TM_GTD_DIRECTORY needs to point to an existing directory containing your default GTD files. You can have multiple directories containing GTD files, and work with each individual set (they are completely independent), but the script needs to know which of these directories you want it to work with.
  2. A variable named TM_GTD_INBOX needs to point to an existing “inbox file”, just a plain text file with lines as described above. (The script will just ignore malformed lines). I suggest calling it inbox.txt and placing somewhere in your Documents, but you can use any name you want.

Now you should be ready to go!

9 Comments »

  1. Richard said,

    June 28, 2006 at 12:52 am

    This line in process_inbox.rb:

    require ‘lib/dialog.rb’

    is failing for me.

  2. Haris said,

    June 28, 2006 at 6:34 am

    @Richard

    you probably need to update your support directory. In the directory where you have your svn downloaded bundles, there should be a structure like this:

    TextMate -> Support
    TextMate -> Bundles
    ……

    In other words there is a “glonal support directory”.
    if not, you need that support directory, and to update it. It contains all sorts of useful tools that programs use.

  3. Richard said,

    June 28, 2006 at 7:35 am

    Thanks. I’m definitely missing the support directory in /Library/Application Support/TextMate/ which is where I check out the Bundles to via svn

    So where do I get this support directory from? Does not seem available via svn - I can only access the bundle directoy that way.

  4. Richard said,

    June 28, 2006 at 7:38 am

    I just looked in the TextMate.app package and there is a support directory in there alongside the bundles and default themes. Should I copy it out of there to /Library/Application Support/TextMate ?

  5. Haris said,

    June 28, 2006 at 2:17 pm

    @Richard

    No, don’t move it out of textmate’s package, that won’t help you at all. TextMate finds it just fine where it is, the problem is that it is outdated. You can use subversion to get it, its location should be:

    http://macromates.com/svn/Bundles/trunk/Support
    

    Just follow the instructions for bundles, but with this path. In fact, you might want to consider getting the whole root:

    http://macromates.com/svn/Bundles/trunk/
    

    This includes the Themes and Tools directories. Btw, you can browse these by going to the above addresses and using login and password anon.

  6. Richard said,

    June 29, 2006 at 4:24 am

    Thanks for the guidance Haris. All is working nicely now. It’s a great bundle - many thanks.

  7. Ron said,

    June 30, 2006 at 11:12 am

    Process of inbox.txt does not seem to be working ATM. Here is the contents of my inbox.tx

    @buy Patio furniture Patio >Patio
    @buy Umbrella for back patio >Patio

    Here is the error it spits out

    /Users/ron/Library/Application Support/TextMate/Bundles/GTDAlt.tmbundle/Support/bin/processinbox.rb:39: undefined method `addcontexts’ for GTD::GTDFile:Class (NoMethodError)
    from /Users/ron/Library/Application Support/TextMate/Bundles/GTDAlt.tmbundle/Support/bin/process_inbox.rb:31

    This is with a current checkout.

  8. Haris said,

    June 30, 2006 at 11:20 am

    @Ron

    ah, that was one last GTDFile that needed converting to GTD. It should work fine now. (at least that part ;) )

  9. Graham English said,

    May 14, 2007 at 6:19 pm

    I created a special Quicksilver action to append to your inbox. It makes it just a little faster than typing, choosing append…, and then choosing the file to append to. I know you can save append to text as a trigger, but it’s never worked for me.

Leave a Comment