Wednesday, February 23, 2005

First macosxhints post

The problem I had was that I wanted to be able to access and edit my ical calendars on multiple computers without having to sign up to .Mac (being a cheap skate and all). Currently in iCal if you publish from two different computers to one calendar file the changes made by one will not be shown in the other.

These steps should be made on all computers.

  1. Backup your ~/Library/Calendars directory.

  2. Publish your calendars on the web. This can either be hosted on your own computer (follow the excellent guide here) or an external website such as iCal exchange which is free. Make sure that the calendars you wish to share are published in iCal.

  3. Download and install Sunbird. Sunbird is the stand alone mozilla calendar and the clever thing about it is that it allows one to both subscribe to and publish to the same calendar to webdav (iCal only allows you to do one or the other). It uses the same format as iCal. The reason that I do not use it instead of iCal is that I think it looks ugly at the moment. Warning! Sunbird is beta software at the moment but seems stable enough to me.

  4. For each of your iCal calendars set up a corresponding calendar in Sunbird:

    1. Goto File -> New Calendar file.
    2. Enter the file location. Browse to ~/Library/Calendars and pick the corresponding calendar file used in iCal. It will ask you whether you want to overwrite the file, just say yes (remember it is stored on the web).
    3. Enter the remote server URL. This is the URL that you have published your calendar to e.g. http://www.example.com/ical/Home.ics. It is important that this step is followed or it will not work!
    4. I also allow automatic publishing and pick a colour but these are not essential.

  5. Now every time you switch computer BEFORE you start ical, simply load Sunbird, press apple-R to reload the calendars from the web and quit. This basically overwrites the ical calendars with the up-to-date copy that is on the web.


So basically Sunbird is used to sync the web copy with the local copy. Note that you should not run the two programs at once as both are using the same files so the programs could get confused.

I know this is pretty clunky so as an alternative here is a BASH script that can be run instead of opening iCal (wget needs to be installed but Sunbird is not needed):


#!/bin/bash

USER=user
PASSWORD=passwd
URL=http://example.ac.uk/ical/

#Put your calendar names here
for i in Home Work Birthdays
do
wget --http-user=$USER --http-passwd=$PASSWORD $URL$i.ics -O ~/Library/Calendars/$i.ics
done

open -a iCal.app

exit

0 comments: