In this post I am going to mention about how to synchronise the the Gmail attachments with your GoogleDrive account. Suppose you are reading a Gmail message on your mobile, the message contains one or more file attachments, you apply a label (say Google Drive) to that message and automatically all those attachments are saved to one of the folders on your Google Drive.
And since Google Drive will automatically synchronise with your desktop folders, the saved email attachments will be instantly downloaded and become available on your local disk for the online viewing.
Save Gmail Attachments on Google Drive
This process doesn’t require any extra or third party tools or extensions installation but still this is going to work on both web and mobile version of Gmail (including any of your Gmail Apps that support labels).
Follow the following steps to complete the configuration:
- Login to your Google account, create a copy of this sheet in your Google Drive.
- Open the sheet and you should see a new Gmail menu – click “Initialise” and grant the necessary permissions. This is your sheet (see source code) and you are not sharing your Google credentials or data with anyone else.
- Next go the Gmail menu again and select Run then Close the Google sheet.
The Google sheet will monitor your Gmail mailbox in the background (every two minutes) and it will automatically save all the attachments in that message to the Gmail folder on your actual Google Drive which has labeled as Google Drive.
If you are getting errors like “Service invoked too many times” error then you can try increase the trigger duration, follow the following steps below:
Open the same sheet in Google Docs, go to Tools –> Script Editor and then choose Resources –> Current Script Triggers. Change the value of Minutes timer from “Every 5 minutes” to say “Every 15 minutes”.
In case you do not want to run the script in background anymore then go to the same trigger screen and simple delete the “SendToGoogleDrive” time trigger. It should stop the script immediately.