iCal to unix calendar

Because I have a PC right next to my Mac (I hate Windows, but until AutoDesk make Inventor for MacOS X…) I sometimes need to be able to check my diary - which I have recently converted to iCal.

Since the reason I am not on the Mac is because my Significant Other is using it, I need a non-gui, non-AppleScript way of checking what’s on for me today.

Being a refugee from BeOS, and having used various unix (and even VMS - the DOS of the mainframe world!) flavours, I had come across calendar. What I needed was a way to make calendar read from the iCal *.ics files. (Speaking of ICS, Google seems to think I am searching for Internet Connection Sharing. Grr!) Since the files themselves are quite easy to understand, I knocked up a quick python script. Called pycal.py, you can find it at pycal.py.

Grr! Bloody Apple (or, why iCal won't play nice with PHPCalendar)

I’ve been playing around with iCal recently - It’s a great program. I’ve used it to organise everything, including replacing a custom Access Database I’d setup to create a training diary for one of the Touch teams I coach. Now, since my iMac isn’t always connected to the Internet, I created an account with icalx.com so I can access my calendars from home. This site uses the fine program PHPCalendar to parse and represent html versions of your iCal .ics files. And the best thing for me was that I can use iCal’s publish feature to set it up. It was also possible to use PHP calendar to publish on my iMac’s intranet site, but I couldn’t publish to both.

So, being a little BeOS refugee, I set up some links to the files, rather than the scheduled script to copy the files across. Sym-links wouldn’t work (webserver cannot access files that live outside the Sites directory), so I used hard-links. All well and good. Except iCal doesn’t save files, it saves files to a new filename, and then deletes the original file and renames the new copy. So hard-links don’t work. This seems to be the reason why you can ‘share’ an iTunes library between users on the same machine using sym-links (or even aliases) but not with hard-links. I guess it’s back to scheduled copies - or maybe I can get Folder Action scripts to work…