• 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
scripting Calendar
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scripting Calendar


  • Subject: scripting Calendar
  • From: Yvan KOENIG <email@hidden>
  • Date: Wed, 22 Apr 2015 11:37:56 +0200

I am asked to help someone about Calendar which I never used.

I wrote this simple script :

"12/12/12 00:00:00"
set startDate to date result
set day of startDate to 23
set month of startDate to 4
set year of startDate to 2015

set calendarName to "Sans titre"
set theRecurrence to "FREQ=YEARLY;INTERVAL=1"
set theSummary to "the summary"
set theDescription to "the description of a new event"
set alertDate to startDate + 11 * hours
set theScript to "/Users/yvankoenig/Library/Scripts/fake.scpt" # a script really existing on the HD

tell application "Calendar"
tell (first calendar whose name is calendarName)
set theEvent to make new event at end of events with properties {allday event:true, recurrence:theRecurrence, start date:startDate, description:theDescription, summary:theSummary}
tell theEvent
make new open file alarm at end with properties {trigger date:alertDate, filepath:theScript}
end tell
end tell
end tell

It seems to work but as I am curious, I tried to check what is really created with this other script :

tell application "Calendar"
tell (first calendar whose name is "Sans titre")
repeat with anEvent in every event
tell anEvent
its open file alarms
properties of item 1 of result
end tell
end repeat
end tell
end tell

I got :

{trigger interval:0, class:open file alarm, filepath:"", trigger date:date "mercredi 23 avril 2015 11:00:00"}

Is it normal that it returns "" for the filepath ?

Yvan KOENIG (VALLAURIS, France) mercredi 22 avril 2015 11:37:51





 _______________________________________________
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

  • Prev by Date: Re: class reference "date" problems
  • Next by Date: Re: "Expected class name but found application constant or consideration"...
  • Previous by thread: Re: class reference "date" problems
  • Next by thread: Re: Yosemite and activate failures
  • Index(es):
    • Date
    • Thread