Wednesday 15 March 2023

Force Mark all Read Gmaill

 


 

If you are thinking, how can I force mark all Read Gmaill? We can do this using Google scripts (app scripts ) allows us to automate tasks that we can't be bothered to do; I had a really fucking annoying notification of an old as fuck email, so I wanted to force them all into read.

go to there

https://script.google.com

 Put this in

fpunction forceMarkAllUnread() {
var unread = GmailApp.getInboxUnreadCount();
Logger.log("Messages unread in inbox: " + GmailApp.getInboxUnreadCount());

var run = Math.ceil((Math.ceil(unread / 100) * 100) / 500)
Logger.log("run this manny times " + run);
for (let i = 0; i < run; i++) {
do500();
}

function do500() {
var threads = GmailApp.search('is:unread', 0, 500)
threads.forEach((thread) => {
if (thread.isUnread()) {
thread.markRead()
Logger.log(thread.getId());
}
});
}
}


 clck run

No comments:

Post a Comment