Re: Scripting Apple Mail
Re: Scripting Apple Mail
- Subject: Re: Scripting Apple Mail
- From: John Delacour <email@hidden>
- Date: Wed, 30 Apr 2003 11:01:54 +0100
- Mac-eudora-version: 6.0a16
At 9:21 am +0100 30/4/03, Rob Stott wrote:
Hi all, I'm hoping one of you can help me with a simple problem
scripting Apple Mail (I'm probably making a daft mistake).
The daftness is not yours unless you hear otherwise.
I want the script below to read the content of the first message of
a particular mailbox, then delete the message.
It reads the content perfectly, but fails to delete the message,
giving me a "Mail got an error: An error of type 8 has occurred"
message.
You can't 'move' or 'delete' anything in Mail. Prepare for a lot of
scrunchy disk noise and perform this contorted operation instead:
tell application "Mail"
tell account 1
tell mailbox "INBOX"
set m to a reference to its first message
set s to m's content
end tell
end tell
set m's mailbox to mailbox "Deleted Messages"
end tell
s
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.