Update to the Move Mail Applescript

Today I made an update to my move script that allows you to select more than one message and move them all to the “All Mail” folder. You can refer to my Things Mail Script post if you would like to setup a hot key for the script. Here is the code:


tell application "Mail"
set theSelectedMessages to selection
repeat with selected_message in theSelectedMessages
set currentMailbox to the mailbox of the selected_message
set currentAccount to the account of the currentMailbox
set filedMailbox to "All Mail"
move selected_message to mailbox filedMailbox of currentAccount
end repeat
end tell