In macOS/Cocoa, is there a way to use EventKit to open the Calendar.app at a specific date/time?
I use NSWorkspace.sharedWorkspace().launchAppWithBundleIdentifier("com.apple.iCal",
options: .Default, additionalEventParamDescriptor: nil, launchIdentifier: nil)
to open the app, which works.
In an unsandboxed environment I could use a Scripting Bridge object and do:
let calendarApp = SBApplication(bundleIdentifier: "com.apple.iCal") as! CalendarApplication
if let date = todoItem.properties["icalEventStart"] {
calendarApp.viewCalendarAt!(date as! NSDate)
}
But with sandboxing on, I cannot find a way. EventKit has this user-permission layer, so I thought it a likely candidate to use instead of SB.