My Apps Script code, mostly for automating Gmail.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


A collection of my Google Apps Script code, primarily for automating Gmail.

  • - add a label to old email threads in your inbox indicating how many days old they are.
  • - automatically expire emails so they don't spend too long in your inbox.
  • - automatically expire all emails which Gmail categorizes into the "Promotions" tab (combined with
  • - log the number of threads in your inbox.
  • - log the age of the oldest message thread in your inbox.


  1. Visit and create a script for "Blank Project".
  2. Paste the file in.
  3. Follow additional instructions at the top of the file, e.g. to set configuration variables.
  4. Click the name "Untited project" at the top of the screen and change it to something descriptive of what the script does.
  5. In the menu at the top of the screen, go to Resources -> Current project's triggers. This is where you will set your script to run regularly. The instructions at the top of the file should indicate which function and how often.
  6. Profit!