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 |