• 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: Tom Lyon <email@hidden>
  • Date: Sat, 05 May 2012 09:37:04 -0400


On 05/04/2012, at 22:17, Christopher Stone wrote:

After 20 years of practice and a few books like Mastering Regular Expressions?

Oh, you mean the book with two owls on the cover and a huge shotgun hole in it? :D

But seriously, lack of documentation is killing me.  I'm trying to adapt your simple code to move highlighted/selected messages to the folder of choice.  It functions properly for a mailbox in the top hierarchy of "On My Mac" but generates an error ('Error: Mail got an error: Can't get mailbox "some mailbox" Error Number: -1728') for any mailboxes that are in a lower hierarchy. 

The script so far:

try
tell me
activate
end tell
tell application "Mail"
set mailboxList to mailboxes whose ¬
name is not "Drafts" and ¬
name is not "Notes" and ¬
name is not "Deleted Messages" and ¬
name is not "Outbox"


set mailboxNameList to name of mailboxes whose ¬
name is not "Drafts" and ¬
name is not "Notes" and ¬
name is not "Deleted Messages" and ¬
name is not "Outbox"


tell me to set selectedMailboxName to ¬
choose from list mailboxNameList default items "123net" with prompt "Open folder:" with title "Open Folder" with empty selection allowed


if selectedMailboxName is not false and selectedMailboxName is not {} then
set selectedMailboxName to item 1 of selectedMailboxName


repeat with i from 1 to length of mailboxNameList
if item i of mailboxNameList = selectedMailboxName then exit repeat
end repeat


set selectedMailbox to item i of mailboxList
set s to selection

repeat with eachMessage in s
move eachMessage to mailbox selectedMailbox
end repeat

end if


end tell

Any pointers much appreciated.

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

  • Prev by Date: Re: Gui script for Preview
  • 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