ChatGPT is often wrong, but the reason millions of us use it is because, when it gets it right, there’s really nothing else like it.
I had this experience recently while struggling with a seemingly simple problem with Gmail. Long story short, my inbox was out of control, up to six digits in unread messages – and the mere presence of that number was a daily reminder of my bad housekeeping.
None of these unread emails were particularly important. I had tagged and answered key questions, and used filters to surface must-reads. But I had let the weeds completely overtake the Gmail flower bed, and it was high time to get out the trowel.
No problem, I thought, I’ll just take the nuclear option and do a giant “select all” and “mark all as read” to give myself a clean slate. Except that doing this, in many variations, didn’t work. It seems that Gmail has a secret internal limit for bulk operations, and I was way over that number.
Even doing it in batch using Gmail’s search operators didn’t work. My ridiculous inbox had apparently broken Gmail’s brain and Google was in no position to help me.
Luckily, that’s where a tool I now treat like an eccentric uncle (incredibly smart in some ways, disturbing in others) came to the rescue…
Going off script
I found ChatGPT to be most helpful when it took my poorly worded prompt and came up with a solution that would never have crossed my mind in a million years. Usually this involves coding.
For my Gmail problem it was suggested that I use Google Apps Script. This platform is something I’d never heard of (partly because it’s a Google Workspace thing), but it’s apparently an unsung hero for automating simple tasks, especially in apps like Docs, Sheets, and Gmail.
People use Gmail Apps Script, I’ve since learned, to automate all kinds of things, from business administration to drawing spreadsheets for friends. But it was also the trick I needed to get around Gmail’s stubborn limitations on bulk operations.
After the usual back and forth with ChatGPT, he refined a little script that searched my Gmail inbox for chunks of 500 unread threads and marked them as “read”, until I reached the “inbox zero” nirvana that I had assumed would be much simpler to achieve.
The process was as simple as going to Google Apps Script, clicking “New Project”, pasting in the script (which ChatGPT assured me was “fully balanced and tested”), clicking the “Save” icon, then hitting the “Run” button. The script started running in the background and I watched my inbox slowly go down to zero.
How to use ChatGPT?
ChatGPT doesn’t pull its wisdom out of thin air and I’m convinced that its Gmail solution (perhaps a large part of the script itself) was “inspired” by threads like Stack Overflow and Google Support.
The thing is, the Google search didn’t bring up any of them and I had to go around in circles before ChatGPT intervened. The other great strength of chatbots (again, when they get it right) is that they are able to tailor solutions and code to your exact situation.
That doesn’t mean you don’t have to double-check everything they say, and I had a bit of trepidation running a script I didn’t fully understand on my Gmail account. But after analyzing the very basic code for anything that was problematic, I was happy to try it – and I’m glad I did.
For me, this somewhat dry but useful exercise sums up how I currently use chatbots like ChatGPT, and I seem to be in the majority. A recent study highlighted by Search Engine Land suggests that 95% of ChatGPT users still use Google – in other words, the chatbot is a complement to Google rather than a replacement.
ChatGPT is, as I mentioned earlier, that eccentric, sometimes genius uncle I go to with thorny problems that I just can’t solve using pre-chatbot techniques. And while I certainly don’t trust his memory for current events (a recent BBC study found that 45% of AI chatbot responses around current events had a “significant problem”), I’ll always come back to him for those flashes of inspiration.
If you’re in a similar Gmail inbox conundrum and want to try a (perhaps overly sophisticated) solution to get to inbox zero, here’s the Google Apps script code that worked for me (thanks, ChatGPT). My only challenge now is to stay there.
function markAllAsReadSafe() {
var searchBatchSize = 500; // how many threads to request from Gmail at once
var apiMax = 100; // GmailApp.markThreadsRead accepts at most 100 threads per call
var totalMarked = 0;
do {
// get up to searchBatchSize unread threads (newest first)
var threads = GmailApp.search('is:unread', 0, searchBatchSize);
if (threads.length == 0) break;
// process in sub-batches of apiMax
for (var i = 0; i < threads.length; i += apiMax) {
var slice = threads.slice(i, i + apiMax);
try {
GmailApp.markThreadsRead(slice);
totalMarked += slice.length;
} catch (e) {
Logger.log('Error marking threads read for slice starting at ' + i + ': ' + e);
// pause briefly and continue
Utilities.sleep(2000);
}
// small pause to reduce chance of throttling
Utilities.sleep(500);
}
Logger.log('Marked ' + totalMarked + ' threads so far.');
// loop continues if Gmail returned a full batch (means there are probably more)
} while (threads.length === searchBatchSize);
Logger.log('Finished. Total threads marked read: ' + totalMarked);
}
Follow TechRadar on Google News And add us as your favorite source to get our news, reviews and expert opinions in your feeds. Make sure to click the Follow button!
And of course you can too follow TechRadar on TikTok for news, reviews, unboxings in video form and receive regular updates from us on WhatsApp Also.




