• 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: Mail scripting : How to select?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mail scripting : How to select?


  • Subject: Re: Mail scripting : How to select?
  • From: John Maisey <email@hidden>
  • Date: Sun, 11 May 2008 23:34:46 +0100



set selected mailboxes of message viewers to {mailbox "Junk" of  
account "Gérard"}

With "Junk", "Trash" or "Sent" only : no problem!

I have tried to known these names but I never succeed.

Do you want the list of account names or the mailbox names under each account?

Try this:

tell application "Mail"
set myAccountNames to (name of accounts)
repeat with anAccountName in myAccountNames
set theMailboxNames to name of (mailboxes of account anAccountName)
my displayResults(anAccountName, theMailboxNames)
end repeat
end tell

on displayResults(anAccountName, theMailboxNames)
set myText to "Account '" & anAccountName & "' contains mailboxes:" & return
repeat with thisMailboxName in theMailboxNames
set myText to myText & return & "  " & thisMailboxName
end repeat
display dialog myText
end displayResults

Best wishes

John Maisey
www.nhoj.co.uk
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: iChat and Applescript
  • Next by Date: Progress indicator for applescript process
  • Previous by thread: iChat and Applescript
  • Next by thread: Progress indicator for applescript process
  • Index(es):
    • Date
    • Thread