• 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 Message in Mail.app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Deleting Message in Mail.app


  • Subject: Re: Deleting Message in Mail.app
  • From: Courtney Braafhart <email@hidden>
  • Date: Wed, 2 Feb 2005 13:21:07 -0600

Thank you for your ideas!
Wow you have really helped me simplify this script!

I tried the following but I am still getting an error message on the delete and ideas?:

set today to current date
tell application "Mail"
delete (messages of this_Mailbox in mailboxes whose date received is less than today - (13 * days))
end tell


On Feb 1, 2005, at 3:55 PM, Christopher Nebel wrote:

On Feb 1, 2005, at 1:37 PM, Michelle Steiner wrote:

On Feb 1, 2005, at 12:48 PM, Courtney Braafhart wrote:
I would like a script that deletes messages that are older then a certain date. I am having difficulty scripting the basic delete message command. Does anyone have any suggestions? Below is an example of what I am trying to do...script editor does not like the "delete message" part of the script.....
Here's what I came up with. I haven't tried the delete part because I don't want to delete any mail from my system.
set today to current date
tell application "Mail"
repeat with this_Mailbox in mailboxes
set foo to (messages of this_Mailbox whose (date received) ¬
is less than today - (365 * days) * 3) as list
-- three years


        repeat with a in foo
            delete a
        end repeat

    end repeat
end tell
I know that this script works:
tell application "Mail"
    set foo to the selection as list
    delete item 1 of foo
end tell

Theoretically, you should be able to simply say "delete messages of this_Mailbox whose date received is less than ...", with no loop necessary. Like Michelle, I haven't tried it, and for much the same reason. :-)


Alternatively, you could wait until Tiger ships and use a smart mailbox to do this -- see <http://www.apple.com/macosx/tiger/mail.html>. (This isn't a very serious suggestion, but the smart folders *are* nifty.)


--Chris Nebel AppleScript Engineering

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden


This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Deleting Message in Mail.app
      • From: Michelle Steiner <email@hidden>
References: 
 >Deleting Message in Mail.app (From: Courtney Braafhart <email@hidden>)
 >Re: Deleting Message in Mail.app (From: Michelle Steiner <email@hidden>)
 >Re: Deleting Message in Mail.app (From: Christopher Nebel <email@hidden>)

  • Prev by Date: Re: Moving Terminal.app windows
  • Next by Date: Re: Deleting Message in Mail.app
  • Previous by thread: Re: Deleting Message in Mail.app
  • Next by thread: Re: Deleting Message in Mail.app
  • Index(es):
    • Date
    • Thread