简体   繁体   English

以编程方式将ICS文件导入到iCalendar

[英]Programatically import ICS files to iCalendar

I've written an ICS file using the iCalendar module and python. 我已经使用iCalendar模块和python编写了ICS文件。

My trouble is, how can I tell iCalendar to read the ICS file? 我的麻烦是,如何告诉iCalendar读取ICS文件? I thought I could put it in ~/Library/iCalendar/<--->/Events but it seems that just stores the ICS files once they've been imported. 我以为可以将它放在〜/ Library / iCalendar / <---> / Events中,但是似乎导入后仅存储ICS文件。

Does anyone know a way I could do this? 有谁知道我可以做到这一点的方法?

Thanks, 谢谢,

You would use Applescript or Python scripting bridge framework . 你可以使用AppleScript的或Python 脚本桥框架 In either case, tell iCal to add the events. 无论哪种情况,都告诉iCal添加事件。

An example (in Applescript): 一个示例(在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. 或使用相同的方法只是告诉iCal打开和导入该文件。

您可以告诉iCal打开ics文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM