• 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: Cannot open "On My Mac" mailboxes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cannot open "On My Mac" mailboxes


  • Subject: Re: Cannot open "On My Mac" mailboxes
  • From: Luther Fuller <email@hidden>
  • Date: Sat, 05 May 2012 14:41:59 -0500

On May 5, 2012, at 12:24 PM, Luther Fuller wrote:

You may need to refer to a mailbox by its full path name. If you have mailbox "A" at the top level which contains mailbox "H" which contains mailbox "Z", then you have to refer to mailbox "Z" as mailbox A/H/Z.

I haven't done this in a while, so Im not completely sure. Some experimenting is in order.

So, I did some experimenting ...

tell application "Mail"
set frontViewer to (some message viewer whose index is 1)
set mboxList to (selected mailboxes of frontViewer)
set mbox to (item 1 of mboxList) --> «class mbxp» "Outer_Box/Middle_Box/Inner_Box"
-- name of mbox --> "Inner_Box"


my getMailboxLongName(mbox)
end tell

on getMailboxLongName(mbox)
tell application "Mail"
set mboxLongName to (name of mbox)
set mboxContainer to mbox
repeat
try
set mboxContainer to (container of mboxContainer)
set mboxLongName to (name of mboxContainer) & "/" & mboxLongName
on error
return mboxLongName
end try
end repeat
end tell
end getMailboxLongName --------------------------

Notice that the value of mbox contains the long name of the mailbox and it would be nice to be able to read that string, but I don't see how to do that in a one-liner.

So, I wrote the getMailboxLongName handler to do that.

The the slash-delimited string returned by this handler is understood by Mail and you CAN select a mailbox with this ...

tell application "Mail"
activate
set frontViewer to (some message viewer whose index is 1)
set selected mailboxes of frontViewer to {}
delay 1
beep
delay 1
set selected mailboxes of frontViewer to {mailbox "Outer_Box/Middle_Box/Inner_Box"}
end tell

 _______________________________________________
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: 
 >Cannot open "On My Mac" mailboxes (From: Tom Lyon <email@hidden>)
 >Re: Cannot open "On My Mac" mailboxes (From: Christopher Stone <email@hidden>)
 >Re: Cannot open "On My Mac" mailboxes (From: Tom Lyon <email@hidden>)
 >Re: Cannot open "On My Mac" mailboxes (From: Christopher Stone <email@hidden>)
 >Re: Cannot open "On My Mac" mailboxes (From: Tom Lyon <email@hidden>)
 >Re: Cannot open "On My Mac" mailboxes (From: Christopher Stone <email@hidden>)
 >Re: Cannot open "On My Mac" mailboxes (From: Tom Lyon <email@hidden>)
 >Re: Cannot open "On My Mac" mailboxes (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: Cannot open "On My Mac" mailboxes
  • Next by Date: Re: Gui script for Preview
  • Previous by thread: Re: Cannot open "On My Mac" mailboxes
  • Next by thread: Re: Cannot open "On My Mac" mailboxes
  • Index(es):
    • Date
    • Thread