Archive Old Email Messages in Gmail Automatically

The Google Script will archive all email threads in a specific Gmail label that have been inactive for more than a week. It takes the date of the last message in a thread and if it is older than a week, the thread is archived. The current labels is removed as well.