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

Re: Scripting Apple Mail


  • Subject: Re: Scripting Apple Mail
  • From: Rob Stott <email@hidden>
  • Date: Wed, 30 Apr 2003 17:06:27 +0100

Thanks for the hint, John. That seems to be working!

r.

On Wednesday, April 30, 2003, at 11:01 am, John Delacour wrote:

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.
_______________________________________________
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.

References: 
 >Re: Scripting Apple Mail (From: John Delacour <email@hidden>)

  • Prev by Date: Re: Error: Stack overflow
  • Next by Date: Writing a script that mounts servers
  • Previous by thread: Re: Scripting Apple Mail
  • Next by thread: Re: Script in Script Editor MUCH faster than compiled app -- why?
  • Index(es):
    • Date
    • Thread