Re: build a list of mailboxes
Re: build a list of mailboxes
- Subject: Re: build a list of mailboxes
- From: Christopher Stone <email@hidden>
- Date: Sat, 08 Mar 2014 20:48:23 -0600
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
|
_______________________________________________
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