如何在iCalendar中添加和删除事件?
我正在做一个小的Python程序,目的是自动把活动安排到我的iCalendar里。
这个程序大部分已经完成了,现在我有了所有关于活动的信息,但我不知道怎么和iCal进行连接。
我提到了applescript,因为如果通过这个方式安排活动更简单的话,我完全可以使用它。我只需要知道怎么把我的Python脚本里的信息传递给applescript。
为了更清楚,我有活动的标题、开始和结束时间,还有日期。我觉得这些信息应该够了,对吧?
1 个回答
0
打开AppleScript编辑器,查看iCal的库其实是个不错的主意。
这里有一个例子:
tell application "iCal"
tell calendar "My Calendar"
set theDate to current date
make new event at end with properties {description:"Event Description",
summary:"Event Name", location:"Event Location", start date:theDate,
allday event:true}
end tell
end tell