Saturday, February 23, 2013

Automatically Clean Up Gmail on a Schedule with This Script

February 22nd, 2013Top Story

Automatically Clean Up Gmail on a Schedule with This Script

By Melanie Pinola

Automatically Clean Up Gmail on a Schedule with This ScriptMaintaining inbox zero and dealing with old emails takes work (for some, too much work!). This Google Apps script lightens the load a bit by automatically archiving or deleting old emails that are cluttering your inbox, based on a schedule you set.

Whipped up by John Day, these time-based Gmail filters will move old read emails to the trash or auto-archive them.

So, for example, you could automatically get rid of expired daily deals emails or other promotional emails that are more than two days old. First, create a Gmail filter that automatically applies the label "delete me" to that semi-spam when it comes in.

Automatically Clean Up Gmail on a Schedule with This Script

Then the Google Apps script, which you'll need to authorize for your Gmail account, takes care of deleting emails with that label that are older than two days. You can adjust the number of days before messages are moved to the trash in the script (see the delayDays variable and change the 2 to another number) and under the Resources > Current project's triggers... option, set the script to check your inbox every half hour or other interval.

For those old, read emails you want to keep but move out of your inbox, there's another function that archives them. (In the script you can also adjust the older_than search to something other than 2d and add or exclude other labels.)

For more details, see John's post, where he offers the code for you to paste into a new Google Apps Script. I've shared this Google Apps script with the two functions pasted in, so you can just make a copy of it to your account and run it per John's instructions.

Create time-based Gmail filters with Google Apps Script | Johneday via adayzdone

Photo by Storozhenko (Shutterstock)

Number of comments

Is Microsoft About to Announce Xbox 720?

An "Xbox event" domain has been registered by the same group that organized Microsoft's E3 briefing.
If you're having trouble viewing this message please click here.
IGN
Facebook Twitter Forward to a friend
Is Microsoft About to Announce Xbox 720?
Is Microsoft About to Announce Xbox 720?

A new domain suggests that Microsoft could be preparing an event to announce its next console. Click below for more details.

Read More
You are receiving this product notice because you are an IGN Games Newsletter Subscriber. To unsubscribe or tell us more about yourself please update your preferences.

To read about our privacy policy, click here.

Copyright 2013 IGN Entertainment, 625 2nd Street, San Francisco, CA 94107. All Rights Reserved.

IGN.com | GameSpy | AskMen | IGN Prime




Forward to a friend.

Unsubscribe from Email

Can You Run Tomb Raider?

Can your rig handle Lara Croft?
If you're having trouble viewing this message please click here.
IGN
Facebook Twitter Forward to a friend
Can You Run Tomb Raider?
Can You Run Tomb Raider?

Click below for the full list of PC minimum and recommended system requirements that were provided by Square-Enix and Crystal Dynamics.

Read More
You are receiving this product notice because you are an IGN Games Newsletter Subscriber with an interest in PC games. To unsubscribe or tell us more about yourself please update your preferences.

To read about our privacy policy, click here.

Copyright 2013 IGN Entertainment, 625 2nd Street, San Francisco, CA 94107. All Rights Reserved.

IGN.com | GameSpy | AskMen | IGN Prime




Forward to a friend.

Unsubscribe from Email