Files messages in Mail.app using type ahead. Display a dialog for account and one for all mailboxes of that account.
Created by Andreas Zeitler on 2013-09-13
Copyright Mac OS X Screencasts 2013. All rights reserved.
tell application "Mail "
-- choose account
set allAccounts to ( name of every account) as list
choose from list allAccounts with title "Choose Account… " with prompt "Please select one account " without multiple selections allowed
set chosenAccount to result as string
-- choose from all mailboxes from chosen account
if chosenAcount is not "" then
set allMailboxes to ( name of every mailbox of account chosenAccount) as list
choose from list allMailboxes with title "Choose Account… " with prompt "Please select a mailbox " without multiple selections allowed
set chosenMailbox to result as string
-- move selected messages to chosen mailbox of chosen account
set s to selection
if s is not "" then
repeat with currentMessage in s
to ( first mailbox whose name is chosenMailbox) of account chosenAccount
Press h to open a hovercard with more details.