G’day scripters
I’ve got a script, that, in part, restore missing mail by importing from a Carbon Copy Cloner, or Mac in Target mode, sorts throught the imported Mail, and replaces missing mailboxes and messages, then tries to delete the unwanted imports.
Trouble is, under Mail in Sierra, the ‘delete’ command fails now.
Anyone know of a way I can delete unwanted MailBoxes in Mail?
Even tried the script below, which only deleted mailboxes provided they don’t contain other mailboxes.
Regards
Santa
tell application "Mail" set boxList1 to every mailbox whose name is "test" repeat with eachMailbox in boxList1 my cleanup(eachMailbox) end repeat end tell
on cleanup(box) tell application "Mail"
if (count of mailboxes of box) > 0 then repeat with mbx in (get mailboxes of box) my cleanup(contents of mbx) end repeat else delete box end if
end tell end cleanup |