user974703
user974703

Reputation: 1653

Programatically import ICS files to iCalendar

I've written an ICS file using the iCalendar module and python.

My trouble is, how can I tell iCalendar to read the ICS file? I thought I could put it in ~/Library/iCalendar/<--->/Events but it seems that just stores the ICS files once they've been imported.

Does anyone know a way I could do this?

Thanks,

Upvotes: 1

Views: 1247

Answers (2)

the wolf
the wolf

Reputation: 35532

You would use Applescript or Python scripting bridge framework. In either case, tell iCal to add the events.

An example (in Applescript):

tell application "iCal"
   tell calendar "Work"
      set theDate to current date
      make new event at end with properties {description:"The Event Description", 
         summary:"Event Name", location:"Main Street", start date:theDate, 
         allday event:true}
   end tell
end tell

Or use the same method to just tell iCal to open and import that file.

Upvotes: 1

LaC
LaC

Reputation: 12824

You could tell iCal to open the ics file.

Upvotes: 0

Related Questions