gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 19:24:56 25 4
gpt4 key购买 nike

我使用 iCalendar 模块和 python 编写了一个 ICS 文件。

我的问题是,如何告诉 iCalendar 读取 ICS 文件?我以为我可以把它放在 ~/Library/iCalendar/<--->/Events 中,但似乎只在导入 ICS 文件后才存储它们。

有谁知道我可以做到这一点的方法吗?

谢谢

最佳答案

您将使用 Applescript 或 Python scripting bridge framework 。无论哪种情况,请告诉 iCal 添加事件。

示例(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

或者使用相同的方法告诉 iCal 打开并导入该文件。

关于python - 以编程方式将 ICS 文件导入 iCalendar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8495145/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com