Re: Deleting Message in Mail.app
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