• 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
move mailbox?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

move mailbox?


  • Subject: move mailbox?
  • From: Brian Christmas <email@hidden>
  • Date: Thu, 30 Oct 2014 09:41:34 +1100

G’day scripters

While we’re on the subject of Mail deficiencies, I’ve got a curly question.

One of my apps creates a new yearly mailbox in mail, which holds 12 monthly mailboxes, which each contain daily mailboxes, which each contain 3-500 emails.

The list of yearly mailboxes has grown, so I’d like to move them all to a single mailbox, using Applescript.

The script below fails, and using the ‘move’ command, actually delete the Year mailbox (I tested with blank mailboxes, luckily).

Can anyone advise me how to move mailboxes to within mailboxes, please?

Regards

Santa.


tell application "Mail"
tell application "Mail"
if not (exists mailbox "Mail Manager eMails") then make new mailbox with properties {name:"Mail Manager eMails"}
end tell
repeat with x from 2006 to 2014
say x
if exists mailbox ("Year " & x) then copy mailbox ("Year " & x) to mailbox "Mail Manager eMails" # <-- fails
if exists mailbox ("Year " & x) then move mailbox ("Year " & x) to mailbox "Mail Manager eMails" # <-- mailbox disappears, then fails
end repeat
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

  • Prev by Date: Re: Yosemite appears to have broken shell script
  • Next by Date: Re: Create link in OSX Mail
  • Previous by thread: Re: Yosemite Mail issue
  • Next by thread: Use "say" from a background user account?
  • Index(es):
    • Date
    • Thread