ChatGPT is improper a variety of the time, however the cause why thousands and thousands of us use it’s as a result of, when it will get issues proper, there is not actually anything fairly prefer it.
I had that have not too long ago when wrestling with a seemingly easy Gmail drawback. Briefly, my inbox was uncontrolled, nicely into six figures for unread messages – and the mere presence of that quantity was a every day reminder of my poor housekeeping.
None of these unread emails had been notably vital. I might been labeling and replying to key ones, and utilizing filters to floor the must-reads. However I might let the weeds fully overwhelm the Gmail flower mattress, and it was high-time I acquired the trowel out.
No drawback, I believed, I will simply take the nuclear choice and do a large ‘choose all’ and ‘mark all as learn’ to offer me a clear slate. Besides doing that, in lots of variations, did not work. Gmail, it appears, has a secret inside restrict for bulk operations, and I used to be approach over that determine.
Even doing it in batches utilizing Gmail’s search operators wasn’t working. My ridiculous inbox had seemingly damaged Gmail’s mind, and Google was unable to assist.
Luckily, that is the place a software that I now deal with like an eccentric uncle (extremely good in some methods, worryingly mistaken in others) got here to the rescue…
Going off script
I’ve discovered ChatGPT to be most useful when it is taken my poorly-worded immediate and provide you with an answer that will have by no means crossed my thoughts in one million years. Often, this entails coding.
For my Gmail drawback, it instructed utilizing Google Apps Script. This platform is one thing I might by no means heard of (partly as a result of it is a Google Workspace factor), but it surely’s apparently a little bit of an unsung hero for automating easy duties, notably in apps like Docs, Sheets and Gmail.
Individuals use Gmail Apps Script, I’ve since realized, to automate all kinds of issues, from enterprise admin to sweepstake spreadsheets for buddies. However it was additionally the trick I wanted to get round Gmail’s cussed limits for bulk operations.
After the same old back-and-forth with ChatGPT, it refined a small script that searched my Gmail inbox in chunks of 500 unread threads and marked them as ‘learn’, till I hit the ‘inbox zero’ nirvana I might assumed it will be a lot easier to succeed in.
The method was so simple as going to Google Apps Script, clicking ‘New Mission’, pasting within the script (which ChatGPT assured me was “absolutely balanced and examined”), clicking the ‘Save’ icon, then hitting the ‘Run’ button. The script started whirring away within the background and I watched my inbox slowly tick all the way down to zero.
How do you utilize ChatGPT?
ChatGPT would not get its knowledge from nowhere and I’ve little doubt that its Gmail answer (possibly giant components of the script itself) had been ‘impressed’ by threads from the likes of Stack Overflow and Google Assist.
The factor is, Googling did not floor any of them and I used to be left operating round in circles earlier than ChatGPT intervened. The opposite massive energy of chatbots (once more, once they get issues proper) is that they are capable of tailor options and code to your precise state of affairs.
That does not imply you do not have to double-check every little thing they are saying, and I did have a small quantity of trepidation in operating a script I did not absolutely perceive on my Gmail account. However after scanning the very fundamental code for something troublesome, I used to be joyful to offer it a spin – and I am glad I did.
For me, this barely dry however helpful train summed up how I presently use chatbots like ChatGPT, and it appears I am within the majority. A latest examine highlighted by Search Engine Land suggests {that a} huge 95% of ChatGPT customers nonetheless use Google – in different phrases, the chatbot is a complement to Google relatively than a alternative.
ChatGPT is, as I discussed earlier, that eccentric, typically genius uncle I am going to with thorny issues that I simply cannot remedy utilizing pre-chatbot methods. And whereas I actually do not belief his recall of reports occasions (a latest BBC examine discovered that 45% of AI chatbot solutions round information had a “vital challenge”), I will at all times come again to him for these flashes of inspiration.
For those who’re in an identical Gmail inbox conundrum to me and wish to strive a (presumably over-engineered) answer to succeed in inbox zero, this is the Google Apps Script code that labored for me (thanks, ChatGPT). My solely problem now’s staying there.
perform markAllAsReadSafe() {
var searchBatchSize = 500; // what number of threads to request from Gmail directly
var apiMax = 100; // GmailApp.markThreadsRead accepts at most 100 threads per name
var totalMarked = 0;
do {
// stand up to searchBatchSize unread threads (latest first)
var threads = GmailApp.search('is:unread', 0, searchBatchSize);
if (threads.size == 0) break;
// course of in sub-batches of apiMax
for (var i = 0; i < threads.size; i += apiMax) {
var slice = threads.slice(i, i + apiMax);
strive {
GmailApp.markThreadsRead(slice);
totalMarked += slice.size;
} catch (e) {
Logger.log('Error marking threads learn for slice beginning at ' + i + ': ' + e);
// pause briefly and proceed
Utilities.sleep(2000);
}
// small pause to cut back likelihood of throttling
Utilities.sleep(500);
}
Logger.log('Marked ' + totalMarked + ' threads up to now.');
// loop continues if Gmail returned a full batch (means there are most likely extra)
} whereas (threads.size === searchBatchSize);
Logger.log('Completed. Complete threads marked learn: ' + totalMarked);
}
Observe TechRadar on Google Information and add us as a most well-liked supply to get our skilled information, evaluations, and opinion in your feeds. Ensure to click on the Observe button!
And naturally you can too observe TechRadar on TikTok for information, evaluations, unboxings in video type, and get common updates from us on WhatsApp too.

