Skip to main content

One common task of any paperless system is to handle email attachments. If you are using GMail and Drive there is a nifty way to pull this off with a Google Apps Script.

One big advantage of Gmail is its implementation of server-side rules. This allows for email processing without the need to have a computer running somewhere. Combined with a Google Apps Script you can use the filter to identify the emails containing the attachments and attach a specific label. The script will watch this label, save the attachment to your Google Drive and remove the label from the email.

So, first create a filter such as

from:(sender,) subject:Test has:attachment

and have it apply a label (in this example „GoogleDrive“).

Next, head to the Chrome Web Store and search for Mail to Drive. The „app“ is from Boris Wilhelms and I am extremely thankful for him making this available. During the installation of the script you will be asked to grant the script permission to access your Gmail and Drive.

From there you can have the wonderful Hazel tool to automatically process the attachment into your paperless system. So this script allows for automatic, server-side saving of specific email attachments to your cloud storage. The next logical step would be to develop something like a cloud-based Hazel. IFTTT is awesome I know but it is nothing compared to what Hazel can do on a Mac. Anyone interested? I’m in.

 

Sven

Author Sven

More posts by Sven

Join the discussion One Comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.