• 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: build a list of mailboxes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: build a list of mailboxes


  • Subject: Re: build a list of mailboxes
  • From: "koenig.yvan" <email@hidden>
  • Date: Sun, 09 Mar 2014 09:47:34 +0100


Le 09/03/2014 à 03:48, Christopher Stone <email@hidden> a écrit :

On Mar 08, 2014, at 17:59, Shane Stanley <email@hidden> wrote:
Is there some reason you can't ask for the name of the mailbox?
______________________________________________________________________

If all Yvan needs are the names then no.

tell application "Mail"
name of mailboxes
end tell

You used to be able to do this to get the paths of all On-My-Mac mailboxes:

tell application "Mail"
set AppleScript's text item delimiters to linefeed
mailboxes as string
end tell

But it no longer works as of Mountain Lion.

Now you have to do something like this:

-------------------------------------------------------------------------------------------
tell application "Mail"
  try
    mailboxes as string
  on error e
    set AppleScript's text item delimiters to {"Can’t make {", "} into type string."}
    set mBoxList to text item 2 of e
    set AppleScript's text item delimiters to linefeed
    do shell script "perl -p -e 's! *«class mbxp» *!!g; s! *of application \"Mail\",? *!\\n!g; s!\"!!g' <<< " & quoted form of mBoxList without altering line endings
    text items of result
  end try
end tell
-------------------------------------------------------------------------------------------

--
Chris

Hello Christopher

You understood what I need but you forgot a detail.

What you decipher is an English error message.
As I am French I didn't get such ones.
Here they are :
(*Il est impossible de rendre «class mbxp» "fournisseurs/Apple/iTunes Store" of application "Mail" en type text.*)

This is why I used 
"«class mbxp» " & quote
and quote &" of application"

as tags to split the messages.

If you may write a shell script able to use the delimiters which I use I am interested.
If you can't I must stay with my bad old code.

Yvan KOENIG (VALLAURIS, France) dimanche 9 mars 2014 09:39:32





 _______________________________________________
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

  • Follow-Ups:
    • Re: build a list of mailboxes
      • From: Axel Luttgens <email@hidden>
References: 
 >build a list of mailboxes (From: "koenig.yvan" <email@hidden>)
 >Re: build a list of mailboxes (From: Shane Stanley <email@hidden>)
 >Re: build a list of mailboxes (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: build a list of mailboxes
  • Next by Date: Re: build a list of mailboxes
  • Previous by thread: Re: build a list of mailboxes
  • Next by thread: Re: build a list of mailboxes
  • Index(es):
    • Date
    • Thread