coaching newsletter contact

Auto-Archiving Emails in Gmail

In the midst of reading for Bookworm, I discovered my habit of quickly checking my email throughout the day. It's a simple habit on the surface, but try to break it and you'll find that willpower alone may not be enough to win.

I set out to create resistance to checking my email from my phone. I can remove it entirely but I have legitimate scenarios that dictate the checking of email on the go. Since I can't remove it, I decided to force difficulties when opening an email in any scenario.

Instead of removing email on my phone, I wrote a Google Apps Script that moves any read message in my inbox to the archive. And it does so once every minute. It's basic and seems to not accomplish much since the messages end up in my archive anyway. But what if I need to reply? What if I need to act on that email? If I open it and don't reply immediately or don't capture in some way, it's gone. Not completely, but it's moved out of sight. And I will likely drop the ball since there is no placeholder in my inbox. That by itself is enough to keep me from opening mails on my phone. I can't have them disappear.

I should warn you that if you decide to set this up, it will be frustrating at first. I failed immediately and checked my email shortly after installing the script. I saw a message I wanted to read but knew I couldn't touch it or it would be gone since I didn't have time to act on it. I spent a lot of time trying to get around this setup and quickly found that I couldn't check a mail without a lot of extra steps. It's a lot easier to not check it at all.

Warning: Before going further, make sure read messages are ready to be archived. They will be moved.

To set this up you need to go to your Google Drive and created a new Google Apps Script. Here's the code to paste into that script:

function autoArchiveGmail() {
var threads = GmailApp.search('label:inbox is:read');
for (var i = 0; i < threads.length; i++) {
threads[i].moveToArchive();
}
}

To run it the first time, click the debugger icon and give the script access to your Gmail:

Once the script is in place, set up a new trigger for it:

I wish you all the best in checking email from your phone.

Thu, Nov 17, 2016 06:00pm CST https://bhlg.us/4kN1
#email

Want to see my August 2020 Bullet Journal setup?

Join 1,514 subscribers!

I'll send you the link to a six-minute overview video of my August 2020 spreads when you sign up for my newsletter, The Weekly Impulse.

Site Analytics

I use Fathom Analytics on this site because I care about your privacy. And if you ever want to see the stats collected and the data I see, check out the live analytics here.

Amazon Affiliate

joebuhlig.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means to earn fees when linking to Amazon.com and affiliated sites.

Disclaimer

Disclosure of Material Connection: Some of the links in the post above might be “affiliate links.” This means if you click on the link and purchase the item, I will receive an affiliate commission. Regardless, I only recommend products or services I use personally and believe will add value to my readers. I am disclosing this in accordance with the Federal Trade Commission’s 16 CFR, Part 255: “Guides Concerning the Use of Endorsements and Testimonials in Advertising.”

an analog mind in a digital world

👋 I'm Joe Buhlig. I strive to build productivity systems that stand the test of time and help me do more than check boxes. I'm here to help you do the same.

🎙 I read a lot of books and talk about it.

🐿 I can't focus on one thing for long, so I write a lot of code for an eclectic grouping of projects.

📓 And I'm a bit obsessed with finding non-proprietary solutions to digital problems. Thus, text files for the win! 🎉

MN U.S.A 1986-09-30
  • all
  • articles
  • code
  • likes
  • notes
  • photos
  • replies
  • reposts
  • steps
  • videos
coaching newsletter contact
© 2014-2025 by Joe Buhlig