Hmm…thats pretty cool! But, is there a way, that It works without the definition of the names of the Mailbox? Maybe the Script should give out the name of the selected Mailbox, is that even possible?
tell application "Mail"
set theAccounts to every account
set accountChoices to {}
repeat with theAccount in theAccounts
set the end of accountChoices to (name of theAccount as string)
end repeat
set theResult to (choose from list accountChoices with prompt "Choose one." without multiple selections allowed) as rich text
set theAccount to the account theResult
set theMessages to every message in the mailbox "INBOX" of theAccount
repeat with theMessage in theMessages
--do something with each of "theMessage"
end repeat
end tell