This script will move to the Trash folder all messages that appear in GMail's All Mail folder without a folder name label. These messages are considered "archived", and will sit in the All Mail folder unless otherwise acted upon.
Some e-mail client applications that access the GMail folders using IMAP will cause messages to be "archived" instead of being deleted. Microsoft Outlook and Mozilla Thunderbird are two such e-mail client applications. This script can be run to send these "archived" messages to GMail's Trash folder. Once in the Trash folder, the messages will then be deleted after 30 days, or manually using the GMail web interface by clicking the link titled "Empty Trash".