Created
April 4, 2018 16:25
-
-
Save mew1033/cbe2df0967d042e76499b2f96a996feb to your computer and use it in GitHub Desktop.
Mark as read script based on http://mikecr.it/ramblings/marking-gmail-read-with-apps-script
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 markArchivedAsRead() { | |
var threads = GmailApp.search('label:unread -label:{inbox, Unsnoozed}'); | |
for (var i=0; i<threads.length; i++) | |
{ | |
var messages = threads[i].getMessages(); | |
var markUnread = 1; | |
for (var j=0; j<messages.length; j++) | |
{ | |
if (messages[j].isInInbox()) | |
markUnread = 0; | |
} | |
if (markUnread) | |
threads[i].markRead(); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment