• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
'Delete' in Mail?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

'Delete' in Mail?


  • Subject: 'Delete' in Mail?
  • From: Brian Christmas <email@hidden>
  • Date: Tue, 25 Apr 2017 21:37:36 +1000

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
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Wall Street Journal Article Citation
  • Next by Date: Recursing through folders and files
  • Previous by thread: Wall Street Journal Article Citation
  • Next by thread: Recursing through folders and files
  • Index(es):
    • Date
    • Thread