• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Calendar scripting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Calendar scripting


  • Subject: Calendar scripting
  • From: Jay Louvion <email@hidden>
  • Date: Tue, 20 Oct 2015 11:35:54 +0200


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.

Jay Louvion | Les Studios Casagrande Sàrl
3, rue Müller-Brun
1208 Geneva
T+4122 840 32 72 
F+4122 840 32 71 
BLOG | Facebook | www.studiocasagrande.com


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Calendar scripting
      • From: Christopher Stone <email@hidden>
    • Re: Calendar scripting
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: ApplescriptObjC
  • Next by Date: Re: Calendar scripting
  • Previous by thread: Re: ApplescriptObjC
  • Next by thread: Re: Calendar scripting
  • Index(es):
    • Date
    • Thread