我正在编写一个applescript,以从订阅的日历中获取所有事件并将它们转换为另一个日历中的全天事件。以下是我目前不完整的代码:
tell application "Calendar"
tell calendar "Canvas"
set listEvents to every event whose allday event is false
end tell
tell calendar "Update"
set noMatchList to {}
set listAllDayEvents to every event whose allday event is true
if listAllDayEvents is null then
set listAllDayEvent to {0}
end if
repeat with firstEvent in listEvents
repeat with secondEvent in listAllDayEvents
if firstEvent is not equal to secondEvent then
set end of noMatchList to firstEvent
end if
end repeat
end repeat
...
我遇到的问题是如果listAllDayEvents
为空,即更新日历中没有全天事件,执行停止并且永远不会进入 if 语句。有什么问题,有没有办法解决它?