I’m making an attempt to make use of pythonista so as to add occasions to the IOS calendar. I’m making an attempt to make use of EventKit via objc_util, however I can not seem to get it to work.
I’ve tried looking up find out how to do it and used AI, however nothing is working. the code I presently have is
import objc_util
import datetime
# Get mandatory courses from the EventKit framework
EKEventStore = objc_util.ObjCClass('EKEventStore')
EKEvent = objc_util.ObjCClass('EKEvent')
# Initialize an EKEventStore occasion
event_store = EKEventStore.new()
new_event=EKEvent.eventWithEventStore_(event_store)
new_event.setTitle_("Take a look at Occasion")
new_event.setStartDate_(objc_util.ns(datetime.datetime(2024, 12, 15, 10, 0))) # Dec 15, 2024, 10:00 AM
new_event.setEndDate_(objc_util.ns(datetime.datetime(2024, 12, 15, 11, 0))) # Dec 15, 2024, 11:00 AM
def none():
go
event_store.saveEvent_span_error_(new_event,0,None)
which I anticipated so as to add A occasion to my calendar but it surely did not, and the code would not give any errors.
thanks for taking your time to learn this.