The following AppleScript successfully creates an event but it isn’t visible on the calendar until either I manually select Refresh Calendars in the View menu or wait until the Calendar syncs up with the server.
set calendarName to "Home"
set theSummary to "Event Title"
set theDescrption to "The notes for the event"
set theLocation to "Karl's House"
set startDate to "September 15, 2014 9:30:00 AM"
set endDate to "September 15, 2014 1:00:00 PM"
set startDate to date startDate
set endDate to date endDate
tell application "Calendar"
tell (first calendar whose name is calendarName)
make new event at end of events with properties {summary:theSummary, start date:startDate, end date:endDate, description:theDescrption, location:theLocation}
end tell
end tell
Questions:
1. How can I trigger an immediate refresh? The AppleScript dictionary command reload calendars doesn’t do it.
2. How can I trigger an immediate opening of the event?
Thanks,
Bill Vlahos