07.17.06

GTDAlt and iCal

Posted in TextMate, GTD at 8:02 am by Haris

This is what you’ve all been waiting for! GTDAlt now has a first level of synchronization with iCal.

Well, it’s not that simple really. First of all, it hasn’t been tested much yet, so your feedback is welcomed, and you can use these comments to post your problems and such.

Now, on to how things work. There is a command in the GTDAlt bundle called “Synchonize with iCal”. What this does is run an applescript that does some magic. First, it will look at all the contexts defined in TM_GTD_CONTEXT and create a calendar for each of them, called “GTDALTemail” and so on. DO NOT RENAME THESE CALENDARS. It will also populate these calendars with the various items, turning them into todos. You would expect dates marked with at instead of due to show up as actual events, but I haven’t implemented this yet.

You should not edit these todos, except for marking them as complete. You should definitely not change the title of the todo, because then the script can’t find it. You could add a note to the todo, but then the note will be lost next time you synchronize. The only thing that the script respects atm is marking something as complete. In that case, the corresponding item in gtdalt will be marked as complete, and the completed todo from iCal will be removed. One thing that doesn’t work as expected is that the completion date that the item will be marked with is the date that the synchronization script ran, not the date that the item was marked completed in iCal.

Another unexpected thing that needs to be fixed is the behavior when you mark an item as completed in gtdalt and then run the cleanup program. In that case, the corresponding item in iCal will remain there until you manually remove it. Not ideal, but to be fixed soon hopefully.

Well, this is it, the brave ones among you should go ahead and give it a try, and help me smooth out the wrinkles. And make sure to backup and stuff.

Later

22 Comments »

  1. Nathaniel Nutter said,

    July 17, 2006 at 1:05 pm

    I am going to give it a go. This is what I have been waiting for. I like the idea of GTD and the way you have implemented it but I also like the visual representation iCal gives. Awesome work! I’ll let you know if anything bad happens.

  2. Haris said,

    July 17, 2006 at 3:34 pm

    Thanks Nathan! I just updated the script, the previous one seemed to be broken. Hope this one works a bit better.

  3. Alan said,

    July 17, 2006 at 3:58 pm

    This is awesome, Haris. But, I’ve hit a snag. The first time I synchronized, all my todos were created in iCal, but since then, no changes get synchronized. So, if I mark a task as done in iCal, it doesn’t sync over to GTDAlt, and if I add or remove a task in GTDAlt, the change doesn’t show up in iCal when I synchronize. (I’m using rev. 4389.)

  4. Haris said,

    July 17, 2006 at 10:26 pm

    Alan you are right, it doesn’t seem to work here very well either. I’m working on it, but debugging applescripts is a real pain. Any help from experts would be really appreciated.

  5. Haris said,

    July 17, 2006 at 11:05 pm

    Alan, I just committed what I hope to be a fix. Give it a try with rev. 4397.

  6. Alan said,

    July 18, 2006 at 10:38 am

    That seemed to do the trick, at least for me. New tasks get synched over to ical, and checked tasks get marked as complete in my GTD file. Nice!

    Applescript never fails to confound me.

  7. Richard said,

    July 23, 2006 at 2:09 am

    Nice! I notice on my setup that the script fails when I have Next Actions with notes attached. When I removed the note from an action, all worked nicely.

    I noticed that the script didn’t get as far as the “This may take some time” dialog in the case with notes.

  8. Haris said,

    July 23, 2006 at 6:52 am

    This is interesting, it shouldn’t fail for notes as far as I can see. Does this happen no matter what item the notes is for? Can you send me the text of the note?

    The script loads a bunch of data in a very volatile way, by essentially executing a string, and it is easy to break it by having some unescaped characters or something in the string.

  9. Richard said,

    July 23, 2006 at 4:17 pm

    Ah, my bad.

    It was the unescaped ” ” in the note that was the problem. Sorry to lead you down the wrong path here. But if I remove the ” ” from the note text, all is good again.

  10. Haris said,

    July 23, 2006 at 6:04 pm

    No you didn’t lead me down the wrong path. These are things I should fix, you shouldn’t have to worry about what characters to use or not use in the notes. I don’t understand though, what is the character that is not escaped? Is it double quotes?

  11. Richard said,

    July 24, 2006 at 2:35 am

    Yeah, the note was a quote wrapped in double quotation marks.

  12. Haris said,

    July 24, 2006 at 6:02 am

    Thanks, I should definitely fix it to escape those. I’ll do that when I get some time, a couple of weeks probably.

  13. Damien Pollet said,

    August 29, 2006 at 4:25 am

    Hi Haris,

    I just discovered that iCal can group calendars :)
    What about makind a GTDalt group instead of adding a prefix to each context ?

    Thanks again for that great bundle :)

  14. Haris said,

    August 29, 2006 at 5:57 am

    Hi Damien,

    It can group calendars, but it doesn’t resolve name conflicts. In other words, if you have a calendar called “office”, then it can’t create a new calendar called office inside the GTDAlt group, and I definitely don’t want such a situation, in case it might result in data loss of the original office calendar. I could indeed put them all in a group, not a bad idea in itself, but I do still need the prefixes to keep them distinct from everything else going on in your iCal.

    I wonder though, if you could yourself move the calendars inside a group. Once they have been created, this might be doable. Though I wouldn’t want to risk it, so make backups if you try it.

  15. Damien Pollet said,

    August 30, 2006 at 6:11 am

    Yes I moved them in a group, but the prefix is still in the way… with a suffix like “context (GTDalt)” it would be possible to reduce the calendar list width and still see the meaningful part of the name.

    Also I’m not sure it actually added anything in the calendars (even before grouping), but I should test this precisely when I have some time.

  16. Graham English said,

    May 14, 2007 at 7:19 pm

    Sync isn’t working perfectly for me. Syncing created all the calendars in iCal, but only 1 action got synced. I checked that single action as completed in iCal and it did sync properly in GTDAlt. So that’s interesting.

    I don’t do much work in iCal other than scheduling appointments, so it’s not that big of a deal, but it would be nice. If you have any suggestions, I’d greatly appreciate it.

  17. Haris said,

    May 15, 2007 at 5:24 am

    @Graham

    This used to happen because of “weird characters” in the action descriptions, but I thought I had fixed it for the most part. Can you send me a small test sample that doesn’t sync properly?

  18. Graham English said,

    May 16, 2007 at 7:37 am

    Thanks for responding Haris. How do I send it to you? And when you say samll test sample, what do you mean exactly? Do you want my GTD file? Or something else? Thanks!

  19. Haris said,

    May 16, 2007 at 7:15 pm

    @Graham

    My last name at hanover dot edu would do it. My guess about your problems is that something is wrong with your GTD file, so if you send me that then perhaps I can help a bit more. Also emailing the TextMate users list helps, since first of all there are more people that can help you there and most importantly answers are being archived. In fact you might want to search the list archives for this problem, it might have come up in the past and you might get some hints from there.

    I’ve been meaning to work on that script for some time now, but haven’t had much free time and also the thought of looking at Applescript code is not a pleasant one.

  20. Graham English said,

    May 16, 2007 at 10:05 pm

    Everything’s working fine now. I’m not sure what it was. There were no strange or invisible characters. I did notice a couple contexts that were imported from Kinkless but I forgot to add to the prefs. But when I added them, it still didn’t sync.

    So I erased everything, started from scratch, created a single project, and it worked. Then I started adding my projects 1 by 1 and synced along the way. It didn’t take that long and it was really good practice for quick entry of projects, actions, etc.

    One question though, I can’t tell for sure from the comments above if it’s okay to put the GTDAlt calendars into a group?

  21. Haris said,

    May 17, 2007 at 5:20 am

    One question though, I can’t tell for sure from the comments above if it’s okay to put the GTDAlt calendars into a group?

    You can try and see if it works ;) . I think you should be able to do that, as long as you don’t change their name.

  22. Graham English said,

    May 19, 2007 at 3:41 pm

    A quick follow up. Putting the calendars into a group doesn’t affect syncing.

Leave a Comment