Creating iCal events from messages in Mail.app

I just wrote a small bit of AppleScript that creates one iCal event for every selected email in Mail.app.

Installation

Use

email2ical creates one iCal event for every selected email message in Mail.app. The summary of the event will be taken from the subject of the email message, while the description of the event will be taken from the body of the message.

Each event is created EventOffset after the current date and time (rounded down to the current hour) and lasts for EventDuration.

Event alarms are created at AlarmOne and AlarmTwo minutes before or after the event (use negative integers for an alarm before the event starts).

If entries in EmailAddress2calendar can be matched to one of the email addresses the message was delivered to, then the event will be created in the corresponding calendar. Note: Partial matches are valid. Set DefaultCalendar to a reasonable value that can be used if an address is not found in EmailAddress2calendar.