Skip to main content
deleted 1 characters in body
Source Link
ale
  • 19.7k
  • 34
  • 111
  • 161

Did you say Google Script?

Marking Gmail read with Apps Script

The idea behind this script is to mark as read any message that is not in the Inbox (i.e., has been archived).

  1. Head to script.google.com to start a script.
  2. Choose to create a script for Gmail in the little popup.
  3. Delete all the sample code it gives you.
  4. Replace it with this (written using the API reference):
    function markArchivedAsRead() {
    
var threads = GmailApp.search('label:unread -label:inbox');`; GmailApp.markThreadsRead(threads); };</pre>
  1. Save the project with File > Save.
  2. Add a new version using File > Manage Versions and enter "initial version" then submit that.
  3. Do a test run using Run > markArchivedAsRead and be sure and authorize the app when it asks you to.
  4. Add a new trigger using Resource > Current Project's Triggers and choose to run the above function every minute.
  5. Save the script again and exit.

I don't know that it's necessary to run it every minute, but as long as you run it regularly.

This isn't a direct answer to your issue, and if you have reasons to have unread messages that aren't in your inbox this won't work for you.

Did you say Google Script?

Marking Gmail read with Apps Script

The idea behind this script is to mark as read any message that is not in the Inbox (i.e., has been archived).

  1. Head to script.google.com to start a script.
  2. Choose to create a script for Gmail in the little popup.
  3. Delete all the sample code it gives you.
  4. Replace it with this (written using the API reference):
    function markArchivedAsRead() {
    
var threads = GmailApp.search('label:unread -label:inbox');` GmailApp.markThreadsRead(threads); };</pre>
  1. Save the project with File > Save.
  2. Add a new version using File > Manage Versions and enter "initial version" then submit that.
  3. Do a test run using Run > markArchivedAsRead and be sure and authorize the app when it asks you to.
  4. Add a new trigger using Resource > Current Project's Triggers and choose to run the above function every minute.
  5. Save the script again and exit.

I don't know that it's necessary to run it every minute, but as long as you run it regularly.

This isn't a direct answer to your issue, and if you have reasons to have unread messages that aren't in your inbox this won't work for you.

Did you say Google Script?

Marking Gmail read with Apps Script

The idea behind this script is to mark as read any message that is not in the Inbox (i.e., has been archived).

  1. Head to script.google.com to start a script.
  2. Choose to create a script for Gmail in the little popup.
  3. Delete all the sample code it gives you.
  4. Replace it with this (written using the API reference):
    function markArchivedAsRead() {
    
var threads = GmailApp.search('label:unread -label:inbox'); GmailApp.markThreadsRead(threads); };</pre>
  1. Save the project with File > Save.
  2. Add a new version using File > Manage Versions and enter "initial version" then submit that.
  3. Do a test run using Run > markArchivedAsRead and be sure and authorize the app when it asks you to.
  4. Add a new trigger using Resource > Current Project's Triggers and choose to run the above function every minute.
  5. Save the script again and exit.

I don't know that it's necessary to run it every minute, but as long as you run it regularly.

This isn't a direct answer to your issue, and if you have reasons to have unread messages that aren't in your inbox this won't work for you.

Source Link
ale
  • 19.7k
  • 34
  • 111
  • 161

Did you say Google Script?

Marking Gmail read with Apps Script

The idea behind this script is to mark as read any message that is not in the Inbox (i.e., has been archived).

  1. Head to script.google.com to start a script.
  2. Choose to create a script for Gmail in the little popup.
  3. Delete all the sample code it gives you.
  4. Replace it with this (written using the API reference):
    function markArchivedAsRead() {
    
var threads = GmailApp.search('label:unread -label:inbox');` GmailApp.markThreadsRead(threads); };</pre>
  1. Save the project with File > Save.
  2. Add a new version using File > Manage Versions and enter "initial version" then submit that.
  3. Do a test run using Run > markArchivedAsRead and be sure and authorize the app when it asks you to.
  4. Add a new trigger using Resource > Current Project's Triggers and choose to run the above function every minute.
  5. Save the script again and exit.

I don't know that it's necessary to run it every minute, but as long as you run it regularly.

This isn't a direct answer to your issue, and if you have reasons to have unread messages that aren't in your inbox this won't work for you.