• 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 'mail' from OS X
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: scripting 'mail' from OS X


  • Subject: Re: scripting 'mail' from OS X
  • From: cricket <email@hidden>
  • Date: Sun, 17 Mar 2002 17:54:35 -0800

On Sunday, March 17, 2002, at 12:09 PM, Gerd wrote:

i am trying for example to delete messages in a folder (mailbox).
In Claris Emailer following worked fine:

tell application "Claris Emailer"
activate
open folder "backmails"
open first message of folder "backmails"
get content of first message of folder "backmails"
set y to result
delete first message of folder "backmails"
close front window
end tell

But in 'mail' i did not find out how it works. I allways get error messages, for example:

mailbox 'backmail' does not understand the open message
or something like
scripterror no.3

In Mail, all mailboxes belong to accounts, so that's part of the problem. Also, not everything you're trying to do here is possible in Mail yet, like the opening of messages in the UI or deleting messages. But, this script should work for you:

tell application "Mail"
set theMessage to first message of mailbox "backmails" of account "Personal Mailboxes"
set y to content of theMessage
end tell

This will set y to the content of the first message in this particular mailbox.

Are there anywhere samplescripts how to work with 'mail' ?

There are some samples scripts on your boot volume here:

/Applications/AppleScript/Example Scripts/Mail

- cricket

----->
Software Entomologist/Mail for Mac OS X email@hidden
---------->
Your life. To go.
_______________________________________________
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.

  • Follow-Ups:
    • Re: scripting 'mail' from OS X
      • From: email@hidden (Gerd)
References: 
 >scripting 'mail' from OS X (From: email@hidden (Gerd))

  • Prev by Date: Re: Try these
  • Next by Date: Folder actions and remote apps
  • Previous by thread: scripting 'mail' from OS X
  • Next by thread: Re: scripting 'mail' from OS X
  • Index(es):
    • Date
    • Thread