Skip to content

Instantly share code, notes, and snippets.

@latentflip
Last active December 10, 2015 16:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save latentflip/4462403 to your computer and use it in GitHub Desktop.
Save latentflip/4462403 to your computer and use it in GitHub Desktop.
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