ChatGPT gets it wrong a lot of the time, but the reason millions of us use it is because when it gets things right, there’s really nothing else like it.
I had that experience recently when I was struggling with a seemingly simple Gmail problem. In short, my inbox was out of control, well into six figures for unread messages—and the mere presence of that number was a daily reminder of my poor housekeeping.
None of these unread emails were particularly important. I had marked and answered the most important ones, and used filters to display the must-reads. But I let the weeds completely overwhelm Gmail’s flower bed, and it was high time I got 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 me a clean slate. Apart from doing that, in many variations, it didn’t work. Gmail, it seems, has a secret internal limit on bulk operations, and I was well over that number.
Even doing it in batches using Gmail’s search operators didn’t work. My ridiculous inbox had apparently broken Gmail’s brain and Google was unable to help.
Fortunately, here’s a tool that I now treat like an eccentric uncle (incredibly clever in some ways, worryingly flawed in others) came to the rescue…
Going out of script
I’ve found ChatGPT to be most helpful when it has taken my poorly worded prompt and come up with a solution that would never have occurred to me in a million years. Usually this involves coding.
For my Gmail problem, it suggested using Google Apps Script. This platform is something I’d never heard of (partly because it’s a Google Workspace thing), but apparently it’s a bit of an unsung hero for automating simple tasks, especially in apps like Docs, Sheets, and Gmail.
People use Gmail Apps Script, as I’ve since learned, to automate all sorts of things, from business admin to raffle spreadsheets for friends. But it was also the trick I needed to get around Gmail’s stubborn limits on bulk operations.
After the usual back and forth with ChatGPT, it refined a little script that searched my Gmail inbox in chunks of 500 unread threads and marked them as ‘read’ until I hit the ‘inbox zero’ nirvana I’d assumed would be much easier to reach.
The process was as simple as going to Google Apps Script, clicking ‘New Project’, inserting the script (which ChatGPT assured me was “fully balanced and tested”), clicking the ‘Save’ icon and then hitting the ‘Run’ button. The script started whirring away in the background and I watched my inbox slowly tick down to zero.
How do you use ChatGPT?
ChatGPT doesn’t get its wisdom from nothing, and I have no doubt that its Gmail solution (perhaps large parts of the script itself) was ‘inspired’ by threads from e.g. Stack Overflow and Google Support.
The thing is, google didn’t show any of them and I was running around in circles before ChatGPT intervened. The other great strength of chatbots (again, when they get things 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 was a little apprehensive about running a script I didn’t fully understand on my Gmail account. But after scanning the very basic code for something cumbersome, I was happy to give it a go – and I’m glad I did.
For me, this somewhat dry but useful exercise summed up how I currently use chatbots like ChatGPT, and it seems I’m in the majority. A recent study highlighted by Search Engine Land suggests that a massive 95% of ChatGPT users still use Google – in other words, the chatbot is a complement to Google rather than a replacement.
ChatGPT, as I mentioned earlier, is the eccentric, sometimes brilliant 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 recall of news events (a recent BBC study found that 45% of AI chatbot responses around news 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 as me and want to try a (possibly over-engineered) solution to reach 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 a preferred source to get our expert news, reviews and opinions in your feeds. Be sure to click the Follow button!
And of course you can too follow TechRadar on TikTok for news, reviews, video unboxings, and get regular updates from us on WhatsApp also.



