Adding an Attendee to an Event
Calendar events can contain attendees. Listing 12-1 and Listing 12-2 demonstrate how to add an attendee to an event.
APPLESCRIPT
tell application "Calendar"
tell calendar "Project Calendar"
set theEvent to (first event where its summary = "Important Meeting!")
tell theEvent
make new attendee at end of attendees with properties {email:"example@apple.com"}
end tell
end tell
reload calendars
end tell
JAVASCRIPT
var app = Application.currentApplication()
var Calendar = Application("Calendar")
var projectCalendars = Calendar.calendars.whose({name: "Project Calendar"})
var projectCalendar = projectCalendars[0]
var events = projectCalendar.events.whose({summary: "Important Meeting!"})
var event = events[0]
var attendee = Calendar.Attendee({email: "example@apple.com"})
event.attendees.push(attendee)
Calendar.reloadCalendars()
Copyright © 2018 Apple Inc. All rights reserved. Terms of Use | Privacy Policy | Updated: 2016-09-13