-
-
Save aviskase/634dba0b10f5cd0bad3f41709ed3e41c 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 hidden or 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