Google App Script - s50600822/Notes GitHub Wiki
// function batchDeleteEmail() { // var batchSize = 100 // Process up to 100 threads at once // //https://developers.google.com/apps-script/reference/gmail/gmail-app#search(String,Integer,Integer) // var threads = GmailApp.search('label:github-notification');// Argument max cannot exceed 500 // //var threads = GmailApp.search('label:github-notification',0,500);// Argument max cannot exceed 500 // Logger.log('Started with %s', threads.length); // for (j = 0; j < threads.length; j+=batchSize) { // GmailApp.moveThreadsToTrash(threads.slice(j, j+batchSize)); // Logger.log('%s deleted', batchSize); // } // }