Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
function archiveOld() {
var threads = GmailApp.search('in:inbox -is:starred older_than:7d');
for (var thread in threads) {
GmailApp.moveThreadToArchive(threads[thread]);
}
}
archiveOld();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment