購読しているカレンダーからすべてのイベントを取得し、それらを別のカレンダーの終日イベントに変換するためのアップルスクリプトを書いています。以下は、これまでの私の不完全なコードです。
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
null の場合、つまり Update カレンダーに終日のイベントがない場合、実行が停止し、if ステートメントに到達しないことです。何が問題で、それを回避する方法はありますか?