Hi all,
Me again, same old question concerning Calendar. Who is running El Capitan or Yosemite and can tell me how long a snippet such as this takes to complete?
On any of my machines, it takes up to 1.6 minutes. Doesn’t that seem kind of lame for scripting?
set theDate to (current date) set ThenTime to time of theDate tell application "Calendar" tell calendar “Work" set timeString to time string of theDate set newEvent to make new event at end with properties {description:"But it took forever", summary:"This has been created at " & timeString, location:"Using applescript", start date:theDate, end date:theDate + 15 * minutes, allday event:false, status:confirmed} set CalendarUID to uid of newEvent set the clipboard to CalendarUID return ((time of (current date)) - ThenTime) / 60 & " minutes" end tell end tell
When it comes do deleting an event, it fails in timeout.
set theDate to (current date) set ThenTime to time of theDate tell application "Calendar" tell calendar “Work" set ThisEvent to event id "E46CAD18-FAB8-4E20-A3B8-CFCCCD03B51C" delete ThisEvent end tell end tell return ((time of (current date)) - ThenTime) / 60 & " minutes"
Many thanks on your insight.
J. |