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.
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