An AppleScript Mail rule handler that cleans .ics calendar files sent from Outlook before importing them into Calendar (iCal) on macOS.
Outlook-generated .ics invitations often include ORGANIZER, ATTENDEE, and PARTSTAT fields that cause import errors or duplicate attendee noise in macOS Calendar. This script:
- Detects
.icsattachments via a Mail.app rule - Saves them to
~/Downloads/<rule-name>/<timestamp>-<filename>.ics - Strips
ORGANIZER,ATTENDEE, andPARTSTATlines usinggrep - Normalizes Windows CRLF line endings with
perl - Opens the cleaned file in Calendar.app and auto-confirms the import dialog
- Removes temporary files
- macOS (tested on Snow Leopard and later)
- Mail.app
- Calendar.app (iCal)
- Accessibility permissions for System Events (for UI scripting)
- Copy the
.scptfile to~/Library/Application Scripts/com.apple.mail/ - In Mail.app, create a rule that matches messages with
.icsattachments and runs this script as the action
- The script is localized for French macOS (the import confirmation dialog button is
"Ajouter"). If your macOS is in English, change"Ajouter"to"Add"in the script. - The
~/Downloads/folder must exist before running.
Apache License 2.0 — see LICENSE.