1
我希望我的腳本來遍歷郵箱的樹和刪除空郵箱:如何刪除郵件的郵箱使用AppleScript
tell application "Mail"
my cleanup(mailbox "Archives")
end tell
on cleanup(box)
tell application "Mail"
if (count of mailboxes of box) > 0 then
repeat with mbx in mailboxes of box
my cleanup(mbx)
end repeat
else
if (count of messages of box) = 0 then delete box
end if
end tell
end cleanup
的「刪除框」會導致錯誤: 錯誤「的郵件得到了一個錯誤:將郵箱的每個郵箱的第1項每個郵箱的「第1項」歸檔「。」從郵箱的每個郵箱的第1項的每個郵箱的項目1號-1728「歸檔」