• 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
Re: Deleting messages in Trash - On My Mac
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Deleting messages in Trash - On My Mac


  • Subject: Re: Deleting messages in Trash - On My Mac
  • From: email@hidden
  • Date: Thu, 15 Mar 2012 08:07:03 -0700

Hi Axel,

This one seems to do want you want:

tell application "Mail"
delete messages of mailbox "Deleted Messages"
end tell

That is, one is referring an application's mailbox, not a mailbox of a "true" account.

This one works perfectly.  Thanks.


But this assumes that the name of that mailbox will always be "Deleted Messages". I wouldn't swear it. So, to play on a perhaps safer side:

tell application "Mail"
repeat with mbox in mailboxes of trash mailbox
if account of mbox is missing value then
delete messages of mbox
end if
end repeat
end tell

Unfortunately, this one doesn't.  It gives me this error:

tell application "Mail"
count every mailbox of trash mailbox
--> 19
get account of item 1 of every mailbox of trash mailbox

Result:

error "No result was returned from some part of this _expression_." number -2763


missing value was highlighted in Script Editor.  Perhaps it has something to do with Mail 4.5 on OS 10.6.7?

Marc
 _______________________________________________
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

  • Follow-Ups:
    • Re: Deleting messages in Trash - On My Mac
      • From: Axel Luttgens <email@hidden>
References: 
 >Deleting messages in Trash - On My Mac (From: email@hidden)
 >Re: Deleting messages in Trash - On My Mac (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: Deleting messages in Trash - On My Mac
  • Next by Date: Re: Deleting messages in Trash - On My Mac
  • Previous by thread: Re: Deleting messages in Trash - On My Mac
  • Next by thread: Re: Deleting messages in Trash - On My Mac
  • Index(es):
    • Date
    • Thread