AppleScript Programming/Sample Programs/Archive selected mail

This script tell is supposed to tell Mail.app to move the selected mails to a certain directory/mailbox. Is supposed to work with gmail, but is not general. It doesn't work unless everything is configured for this script.