• 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: Delete Mail Script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Delete Mail Script


  • Subject: Re: Delete Mail Script
  • From: Brian Christmas <email@hidden>
  • Date: Wed, 07 Aug 2013 10:35:00 +1000

G'day Robert

Try this and see if there's any difference

Regards

Santa

tell application "Mail"
set fetches automatically to false
set selectedMessages to (messages of mailbox "Spam Virus Mail" of mailbox "Personal" whose date received is less than today - (2 * days))
set messcount to (count of selectedMessages)
if (count of selectedMessages) is equal to 0 then
tell application "Finder"
activate
display alert "No mail in the Spam Virus Mail mailbox is older than 2 days" message "Try running this script later on. Rob." giving up after 2
end tell
else
try
repeat with i from messcount to 1 by -1
set theSource to item i of selectedMessages
set background color of theSource to red
delete theSource
end repeat
end try
end if
end tell

On 07/08/2013, at 10:02 AM, Robert <email@hidden> wrote:

tell application "Mail"
set fetches automatically to false
set selectedMessages to (messages of mailbox "Spam Virus Mail" of mailbox "Personal" whose date received is less than today - (2 * days))
set messcount to (count of selectedMessages)
if (count of selectedMessages) is equal to 0 then
tell application "Finder"
activate
display alert "No mail in the Spam Virus Mail mailbox is older than 2 days" message "Try running this script later on. Rob." giving up after 2
end tell
else
try
repeat with i from 1 to messcount
set theSource to item i of selectedMessages
set background color of theSource to red
delete theSource
end repeat 


 _______________________________________________
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

References: 
 >Delete Mail Script (From: Robert <email@hidden>)

  • Prev by Date: Re: Delete Mail Script
  • Next by Date: Delete Mail Script
  • Previous by thread: Re: Delete Mail Script
  • Next by thread: Re: Delete Mail Script
  • Index(es):
    • Date
    • Thread