答案 0 :(得分:1)
您需要两个重复循环,一个重复,直到工作表出现为止,另一个重复,直到工作表消失为止。
tell application "System Events"
tell process "Mail"
repeat until exists sheet 1 of window 1
delay 0.5
end repeat
repeat while exists sheet 1 of window 1
delay 0.5
end repeat
-- sheet was dismissed
end tell
end tell