Skip to content

Instantly share code, notes, and snippets.

@ajmalafif
Forked from latentflip/gmail_scripts.js
Created April 15, 2014 02:45
Show Gist options
  • Select an option

  • Save ajmalafif/10697792 to your computer and use it in GitHub Desktop.

Select an option

Save ajmalafif/10697792 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