I’ve always been a TODO list kinda guy and the only product that I’ve found works well with my PocketPC is Outlook. That’s cool when I’m on client sites (since they all run Outlook), except that I’d like to be able to use some other tool when I’m hacking away on my Macbook.

Well lately I’ve been tinkering with Remember The Milk to see what online TODO managers have to offer. I think RTM is even built by a bunch of Aussies, so it gets extra points. The only thing it doesn’t do yet is Outlook integration… But they do offer a pretty comprehensive REST-based API. You know where I’m heading with this right? How hard could it be?

Ok, so a little bit of XmlSlurper action from Groovy and I’m all set and parsing out my tasks straight from RTM method responses. But how am I going to get to my Outlook tasks? Outlook has got some kinda COM story going on…

I’ve used JNIWrapper in the past for getting to COM based stuff, and it works just great - but the upgrade prices were starting to hurt, so I checked out com4j. Very neat little project - and an almost entire replacement for JNIWrapper. Pointed it at my outlook tlb file and voila! Full set of Java classes to match with Outlook… but then I remembered that Guillaume had done some funky Groovy/COM library that he wrote up for Groovy In Action. Grabbed my copy of GINA and checked it out…

Enter Scriptom. This is the COM integration library that I’ve been looking for. No need to generate any classes, just give it a COM object and start calling methods. Takes advantage of Groovy dynamic typing goodness to make it all very easy.

Need to get to your Outlook tasks? Howse about something like:

import org.codehaus.groovy.scriptom.ActiveXProxy

def outlook = new ActiveXProxy("Outlook.Application")
def namespace = outlook.GetNamespace("MAPI") 

def taskFolder = namespace.GetDefaultFolder(13) // tasks
def tasks = taskFolder.Items

for (i in 1..tasks.Count.value) {
    def task = tasks.Item(i)
    if (task.Complete.value == false) {
        println task.Subject.value
    }
}

Sensational. I'm now in a position where I can get my list of Outlook tasks, and my RTM tasks... now the tricky bit around doing the merge. Both support a "last modified" attribute, so it should be ok to handle the actual time mods, but I'm still not sure how I'm going to handle task renames? I guess I'll need to tag the RTM entries with an Outlook task id... That could get interesting...

Anways, double thumbs up to Scriptom. Guilluame has done some sensational stuff there. Will post some more when I’ve got something working…