• 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: Michelle Steiner <email@hidden>
  • Date: Tue, 1 Feb 2005 14:37:40 -0700

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


-- We're not human beings having a spiritual experience. We're spiritual beings having a human experience.



--
We're not human beings having a spiritual experience.
We're spiritual beings having a human experience.
_______________________________________________
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: Christopher Nebel <email@hidden>
References: 
 >Deleting Message in Mail.app (From: Courtney Braafhart <email@hidden>)

  • Prev by Date: Re: download a file with a progress bar question
  • Next by Date: Re: Performance assistance please
  • Previous by thread: Deleting Message in Mail.app
  • Next by thread: Re: Deleting Message in Mail.app
  • Index(es):
    • Date
    • Thread