I needed related functionality - viz. to show the number of conversations in a "To Do" folder. I was able to come up with a workaround. It is a hack, but I wanted to share it in case anyone finds it useful.
The jist is to set up a repeating Google Script to mark the conversations with the given label as unread. The folder then shows the unread count which happens to be the same as the count of all conversations in the folder. This works well specifically for a "To Do" folder as I expect it to have only a few conversations in it at any given time, and the read/unread status is not that critical.
Everytime I go through the "To Do" folder, the items get marked as read and the item count is not what I want, but my goal is mainly to just get a daily reminder of the count. The script runs everyday and those items will get marked as unread again for the next day.
The specific instructions are:
- Go to https://script.google.com/
- Click on "New project"
- Give the project some name
- In
Code.js
, delete the existing empty function. Add the following code:
function markToDosAsUnread() {
var label = GmailApp.getUserLabelByName("To Do");
var threads = label.getThreads();
for (var i = 0; i < threads.length; i++) {
var thread = threads[i];
Logger.log(thread.getFirstMessageSubject())
thread.markUnread();
}
}
- Click on the clock icon on the left labeled "Triggers"
- Click on "Add trigger"
- Create an hourly or daily trigger that calls the
markToDosAsUnread
function.
- For more details, read the documentation at https://developers.google.com/apps-script/.