If you're a Mac user in a Windows office, you may get a lot of meeting invitations through Exchange. In Mail.app, you can click on the iCalendar attachments and have them added to iCal, but iCal doesn't understand Exchange-generated time zones, so you have to manually change them to US/Eastern, or they will get mangled after syncing with .Mac. I was thinking of ways to automate the process, and came up with the following way to generate a calendar you can subscribe to from the Exchange calendar data.
You can access all the calendar events from IMAP, if your Exchange installation is configured for that, through a folder named Calendar. The basic idea is to grovel through all the messages in that folder, and generate one iCalendar file with all the events. While we're at it, we can also translate Exchange's time zone IDs to ones that iCal understands. This script is ruby code that functions as a CGI script to do just that. Make it available from a web server, and subscribe to, for example (enter as one line, not two, with no spaces, and replace all the obvious buts with your specific info):
You can access all the calendar events from IMAP, if your Exchange installation is configured for that, through a folder named Calendar. The basic idea is to grovel through all the messages in that folder, and generate one iCalendar file with all the events. While we're at it, we can also translate Exchange's time zone IDs to ones that iCal understands. This script is ruby code that functions as a CGI script to do just that. Make it available from a web server, and subscribe to, for example (enter as one line, not two, with no spaces, and replace all the obvious buts with your specific info):
http://server/cgi-bin/exchange2ical.cgi?
server=exchangeimapserver.mycompany.com&user=me&password=xxx
A few caveats:- If you have a lot of calendar items going back years, this is going to be pretty slow; it does no caching.
- I'm not entirely clear on when new invitations get added to your calendar. You may need to leave Outlook running on a Windows machine somewhere.
- You can run the script by hand on the command line (ruby script_name.cgi) and type in the parameters by hand to test it.
- This gives you a read-only view of your Exchange calendar; you will not be able to edit events from iCal.
- If you don't want your email account information going into web server logs, edit the script to hard code the values.
- If you live somewhere other than the US East Coast, add appropriate regexps to the clean_timezone function to translate whatever time zones you encounter.
•
[76,361 views]

