Applescript create event in calendar, how do I remove the default alert?

Posted by zero0cool on Super User See other posts from Super User or by zero0cool
Published on 2012-07-30T05:44:39Z Indexed on 2012/10/16 23:04 UTC
Read the original article Hit count: 208

Running 10.8 Mountain Lion, I'm trying to create a new event with Applescript like this:

set theDate to (current date)
tell application "Calendar"
tell calendar "Calendar"        
    set timeString to time string of theDate
    set newEvent to make new event at end with properties {description:"Last Backup", summary:"Last Backup " & timeString, location:"To a local unix system", start date:theDate, end date:theDate + 15 * minutes, allday event:false, status:confirmed}
    tell newEvent
        delete every display alarm
        delete every sound alarm
        delete every mail alarm
        delete every open file alarm
    end tell        
end tell
end tell

However, this does not remove the default Calendar alert which one can set through Calendar preferences (30 minutes prior in my case).

How do I create an event with no alarms at all through Applescript?

© Super User or respective owner

Related posts about calendar

Related posts about applescript