ChatGPT is I'm wrong most of the timebut the reason millions of us use it is because when it works right, there's really nothing else like it.
I recently had this experience when I was struggling with a seemingly simple Gmail issue. Long story short, my inbox was out of control, my unread messages were in the six figures, and the mere presence of that number was a daily reminder of my poor housekeeping.
None of these unread letters mattered much. I noted and responded to the key ones, and used filters to identify must-reads. But I've let the weeds completely take over the Gmail flower bed, and it's time to get out the trowel.
No problem, I thought, I'll just choose the nuclear option and do a huge “select all” and “mark all as read” operation to start with a clean slate. But in many cases it didn’t work. It seems Gmail has a secret internal limit on bulk transactions, and I exceeded that number by a significant margin.
Even doing it in batches using Gmail search operators didn't work. My ridiculous inbox seemed to break Gmail's brain, and Google couldn't help.
Fortunately, this is where a tool came to the rescue, which I now regard as an eccentric guy (incredibly smart at something, alarmingly wrong about something)…
Exit script
I found ChatGPT to be most useful when it took my poorly worded hint and came up with a solution that would never have occurred to me in a million years. This usually involves coding.
For my problem with Gmail it was suggested to use Google Apps Script. I'd never heard of this platform (partly because it's owned by Google Workspace), but it seems to be something of an unsung hero for automating simple tasks, especially in apps like Docs, Sheets, and Gmail.
Since then, I've learned that people use Gmail Apps Script to automate a variety of tasks, from business administration to sweepstakes spreadsheets for friends. But it was also the trick I needed to get around Gmail's stubborn restrictions on bulk transactions.
After the usual interaction with ChatGPT, he perfected a little script that went through my Gmail inbox in chunks of 500 unread threads and marked them as “read” until I reached the “zero inbox” nirvana I assumed would be much easier to achieve.
The process was as simple as going Google Apps Scriptby clicking “New Project”, pasting the script (which ChatGPT assured me was “fully balanced and tested”), clicking the “Save” icon, then clicking the “Run” button. The script started running in the background and I saw my inbox slowly go to zero.
How do you use ChatGPT?
ChatGPT doesn't pull its wisdom from nowhere, and I have no doubt that its solution for Gmail (perhaps much of the script itself) was “inspired” by topics from sources like Stack Overflow and Google Help Desk.
The thing is, Google didn't find any of them and I had to run around in circles before ChatGPT intervened. The other big power of chatbots (again, when they do it right) is that they can tailor solutions and code specifically to your situation.
That doesn't mean you don't need to double-check everything they say, and I had a little anxiety running a script I didn't fully understand in my Gmail account. But after scanning the most basic code for any problems, I was excited to give it a try—and glad I did.
For me, this is a bit of a dry but useful exercise that sums up how I currently use chatbots like ChatGPT, and I seem to be in the majority. A recent study noted Search engine suggests that 95% of ChatGPT users still use Google. In other words, chatbot is an addition to Google, not a replacement.
As I mentioned earlier, ChatGPT is the eccentric and sometimes brilliant uncle I turn to with tough problems that I just can't solve using pre-chatbot methods. And while I certainly don't trust his recollection of news events (recent BBC research found that 45% of AI chatbot responses regarding news had a “serious problem”), I will always return to it for those flashes of inspiration.
If you've run into the same conundrum I did with your Gmail inbox and want to try a (possibly reverse-engineered) solution to achieving inbox zero, here's the Google Apps script code that worked for me (thanks, ChatGPT). My only task 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 preferred source to get our expert news, reviews and opinions in your feeds. Be sure to click the “Subscribe” button!
And of course you can also Follow TechRadar on TikTok. for news, reviews, unboxing videos and get regular updates from us on whatsapp too much.





