I have been struggling with this for a while now and would appreciate some help!
I have an iCal calendar which I populate via an applescript from email messages. This works fine, but when an event is updated, I would like my script to delete any existing events of the same summary.
tell application "iCal"
tell calendar "MyCalendar"
set theEvent to first event whose summary contains "Job: 18031"
if exists theEvent then
The above script works perfectly if their is an event with “Job: 18031” but if not I get an AppleScript error: The variable theEvent is not defined.