Obnoxiously enough, Mail and iCal do not interoperate well with iCalendar invites sent through Outlook. There are several problems. First, Mail doesn't know what to do with the request... it simply lists the thing as "mime-attachment", and associates no application with it. Second, there are some elements of the MS format that iCal doesn't deal with properly.
I needed an easy solution to this problem. That is, if someone uses Outlook to send a meeting request, I need to be able to bring it up in iCal with one simple action. I first tried some AppleScript-based solutions, but they all had limitations.
My solution uses some Unix shell scripting. It allows you to open up Outlook requests simply by dragging the "mime-attachment" to the desktop. First, open up Terminal, and run the command:
% mkdir ~/binThen put the following text into a file called ~/bin/ical_convert:
#!/bin/bashNote that the line starting with "#!" needs to be the first line of the file, and that the "sed" line has been shown on three lines. Enter it as one continuous line with a space replacing each shown line break.
cd "/Users/viega/Desktop/"
item=mime-attachment
while "true"; do
if [[ -e $item ]]; then
sed "s/ORGANIZER\:MAILTO\:.*/&xxxFRED&/" $item |
sed "s/xxxFREDORGANIZER//" | sed "s/ORGANIZER\:/ORGANIZER\;CN\=/" |
sed "s/CN\=MAILTO\:/CN\=/"> /tmp/iCal.ics
rm $item
open /tmp/iCal.ics
fi
sleep 1
done
% chmod +x ~/bin/ical_convertThe ampersand causes the program to start running, while allowing you to type more commands. Now, you can just drag the attachment to the Desktop, and everything else will happen automatically.
% ~/bin/ical_convert &
progname=ical_convertYou could do a more precise check by dropping a PID into a well-known file and checking that, but whatever.
if [[ `ps -auwwwx | grep $progname | grep -v grep` ]]; then
echo "Ical converter script already running."
else
echo "Starting ical conversion script."
~/bin/ical_convert&
fi
Mac OS X Hints
http://hints.macworld.com/article.php?story=20020912070653117