【发布时间】:2018-04-11 14:44:52
【问题描述】:
我正在尝试通过 Applescript 删除 Apple 内置日历应用程序中的特定日历事件。我可以找到该事件,但无法使用我找到的方法将其删除。
以下脚本定位名为Test Event 的事件并将其显示在日历应用程序中。它工作正常。
set theStarttime to date "Wednesday, 18 April 2018 at 17.00.00"
set theEndtime to date "Wednesday, 18 April 2018 at 18.00.00"
set theSummary to "Test Event"
tell application "Calendar" to tell calendar "Privat"
set theEventList to every event where its start date is greater than or equal to theStarttime
and end date is less than or equal to theEndtime and summary is equal to theSummary
set theEvent to first item of theEventList
show theEvent
end tell
如果我尝试删除事件而不是通过将行 show theEvent 更改为 delete theEvent 来显示它,则脚本执行后该事件仍在日历应用程序中。但是,它似乎以某种方式被删除了,因为脚本无法再找到该事件。
如何从我的日历中删除活动?
【问题讨论】:
标签: calendar applescript