• 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: Philip Aker <email@hidden>
  • Date: Sat, 10 May 2008 23:46:36 -0700

On 08-05-09, at 08:40, awaw wrote:

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.
tell application "Mail"
set x to mailboxes of inbox
set y to count of x
display alert y
set i to 1
repeat y times
set z to  item i of x as string
display alert z
set i to i + 1
end repeat
end tell
==> Erreur d'AppleScript "Il est impossible de rendre «class mbxp» "INBOX" of «class mact» "Gérard" of application "Mail" en type string."

tell application "Mail"
set x to mailboxes of inbox
set y to count of x
display alert y
set i to 1
repeat y times
set z to name of item i of x as string
display alert z
set i to i + 1
end repeat
end tell
==> INBOX
INBOX (y times)

But no names

Is it possible to obtain them otherwise?
Just for the fun now!

Gérard,

Are you trying to get the names of these mailboxes?

tell application "Mail"
set mboxen to mailboxes of every account
set res to {}
repeat with i from 1 to count of mboxen
set end of res to item i of mboxen
end repeat
res
end tell


Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@

Sent from my SE/30

 _______________________________________________
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>)
 >Re: Mail scripting : How to select… (From: Luther Fuller <email@hidden>)
 >Re: Mail scripting : How to select… (From: awaw <email@hidden>)
 >Re: Mail scripting : How to select… (From: Axel Luttgens <email@hidden>)
 >Re1: Mail scripting : How to select… (From: awaw <email@hidden>)

  • Prev by Date: Re: Re1: Mail scripting : How to select…
  • Next by Date: iChat and Applescript
  • Previous by thread: Re: Re1: Mail scripting : How to select…
  • Next by thread: Re: Mail scripting : How to select…
  • Index(es):
    • Date
    • Thread