When scripting EventKit, although I am able to abstract the creation date of an EK event, I am unable to do the same with EK event’s modification date.
I have included only the part of my applescript that raised the error. I can include the remainder of the script,if it would make it easier to comprehend the reason for Applescript’s error.
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
use framework "Foundation"
use framework "EventKit"
… script to create an instance of EKEventStore
…
set newEvent to current application's EKEvent's eventWithEventStore:theEKEventStore
# getting the event's creation date yields an NS Date
set creationDate to newEvent's creationDate() --> (NSDate) "2018-06-09 17:42:33 +0000"
# getting the event's modification date throws an error
set modficationDate to newEvent's modificationDate() --> -[EKEvent modificationDate]: unrecognized selector sent to instance 0x60c0001ba4e0
- Why would EventKit respond to creationDate but not to modificationDate?
- How do I script the instance to recognize the selector, in order to abstract its modification date?