Created
September 25, 2014 15:33
-
-
Save milesgrimshaw/fdca74aabf686df8b009 to your computer and use it in GitHub Desktop.
Google Apps Script to save the count of emails in your inbox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function processInbox() { | |
// get all threads in inbox | |
var threads = GmailApp.getInboxThreads(); | |
data_id = '1t70IDdWcaJzCIIaNWm2nHSPKzetHfTxhkKc9jKkAlpA' | |
var dataSs = SpreadsheetApp.openById(data_id); | |
var sheet = dataSs.getSheets()[0]; | |
var current_date = new Date(); | |
sheet.appendRow([current_date, current_date.toISOString(),threads.length]); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think this would only work correctly, if the thread count in the inbox is below 500