how to make an "archive" button for Mail.app in mac os x mountain lion to work with gmail accounts? has anyone tried to build an "archive" button for apple mail to move mails from the Inbox to All Mail in Mail.app (Mountain lion)? 

there is this page: http://stl.techinno.nl/archive/
but it wont work with the mail version on mountain lion. 

Thanks!
You could assign a shortcut to a script like this:

tell application "Mail" to tell account "Gmail"
    messages of mailbox "INBOX" whose flagged status is false and read status is true
    move result to mailbox "[Gmail]/All Mail"
end tell


This would only move selected messages:

tell application "Mail"
    selected messages of message viewer 1
    move result to mailbox "[Gmail]/All Mail" of account "Gmail"
end tell