Archives your Gmail into a text file in your Google Drive. Attachments are maintained in a separate directory. Attachment names are listed in each text email.
To use this script, just past the code into a new Gmail script file. The only variable which needs to be changed is the year at the beginning of the script.