• 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: Axel Luttgens <email@hidden>
  • Date: Fri, 9 May 2008 14:23:03 +0200


Le 9 mai 08 à 11:29, awaw a écrit :

In Applescript I know ( now ;-) ) how to select a mailbox with :

set selected mailboxes of message viewers to {mailbox The_Box}

But this doesn't run with "inbox", "sent mailbox", "junk mailbox" and "trash mailbox".

Hello Gérard,

inbox, sent mailbox and so on are properties; so, just use them directly, as in:

	tell application "Mail"
		set selected mailboxes of first message viewer to {inbox}
	end tell


Inbox has accounts for sub-folders
Sent mailbox has the same sub-folders than inbox

Junk Mailbox has a "Junk" sub-folder and after the same sub-folders than inbox

Trash Mailbox has a "Deleted Message" sub-folder and after the same sub-folders than inbox

I can built the "path" (Junk/Gérard for example) but I can't select it.

Going further with inbox:

tell application "Mail"
set selected mailboxes of first message viewer to {mailbox "INBOX" of account "Gérard"}
end tell


I got the syntax by asking for "mailboxes of inbox"; I guess it has been made that way so as to avoid name clashes with user-defined mailboxes (as well as to comply with the IMAP model, but that's another point).

HTH,
Axel _______________________________________________
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
References: 
 >Mail scripting : How to select… (From: awaw <email@hidden>)

  • Prev by Date: Mail scripting : How to select…
  • Next by Date: Re: keystroke - cancel modifiers?
  • Previous by thread: Mail scripting : How to select…
  • Next by thread: Re: Mail scripting : How to select…
  • Index(es):
    • Date
    • Thread