If you’ve ever dug through hundreds of emails looking for one invoice, you already know why manually saving attachments is a losing game. I used to drag PDFs into Drive one by one until I finally set up an automated pipeline โ and honestly, it took less time to build than I expected. Below is exactly how I do it, plus a couple of backup methods in case Apps Script isn’t your thing.
What You’ll Need
You don’t need anything fancy for this โ just a Google account and a few minutes.
Step 1: Choose Your Automation Method
There are really three ways to pull this off, and which one you pick depends on how hands-on you want to be.
- Google Apps Script โ free, fully customizable, runs on a schedule you control. This is the method I recommend and the one we’ll build below.
- Zapier or Make โ no code, quick to set up, but the free tiers cap how many “tasks” run per month, which matters if you get a lot of email.
- Third-party Gmail add-ons โ convenient, but you’re trusting another company with access to your inbox, and most charge a subscription after a trial.
I lean toward Apps Script because it’s free forever, lives entirely inside your own Google account, and you can tweak the logic any time you want. That’s the path we’ll walk through in detail.
Step 2: Set Up the Apps Script
Here’s the part that sounds intimidating but really isn’t. Go to script.google.com and click New Project. Give it a name like “Gmail to Drive Saver” so you can find it later โ future you will thank present you.
Delete the placeholder code in the editor and paste this in instead:
This script does three things: it creates (or reuses) a folder called Gmail Attachments in your Drive, searches for messages with attachments that haven’t been processed yet, and labels each one saved-to-drive once it’s done โ that label is what stops the script from re-saving the same files over and over.
Step 3: Automate It With a Trigger
Running the script manually defeats the whole purpose, so let’s set it to run on its own. In the Apps Script editor, click the clock icon on the left sidebar labeled Triggers, then click Add Trigger in the bottom right.
Set the function to run as saveAttachmentsToDrive, choose Time-driven as the event source, and pick Hour timer running every hour. I’ve found hourly checks strike the right balance โ frequent enough that files show up quickly, without hammering your quota.
Step 4: Filter Which Emails Qualify
Saving every single attachment from every email is usually overkill โ you probably just want invoices, receipts, or messages from specific senders. You can narrow the search by editing the GmailApp.search() line in the script. For example, swapping in from:billing@yourvendor.com has:attachment restricts it to attachments from one sender only.
Prefer a no-code route instead? Both Zapier and Make offer a “New Attachment in Gmail” trigger connected to a “Upload File in Google Drive” action. The setup is mostly point-and-click, though I’d recommend adding a filter step so you’re not burning your monthly task quota on newsletter PDFs and marketing flyers.
Pro Tips & Common Mistakes
Wrapping Up
Once this is set up, you’re done thinking about it โ attachments quietly land in Drive without you lifting a finger. It genuinely feels like getting a small chunk of your week back. From here, you might want to set up a similar rule for expense receipts or explore Drive’s search filters to keep the saved files organized as the folder grows.
