We will be sitting in a self-driving car in 2020, but why are we still managing invoices and receipts manually? I went paperless from day one by having invoices, receipts, and billing summary sent my email address. The problem is I detest organizing them manually in Evernote, so I come up with this setup to automate the whole process.

I have two notebooks named as Receipts and Bills. Whenever I receive a receipt or billing summary, I will rename the files and move them to respective notebook. I can handle it in the beginning, but as I increase the number of subscriptions, I find that spending few hours a month to organize these documents is not worth my time.

One day, I decide to write down the steps I follow to properly put these documents in place: I receive an email, the email contains attachment, I download the document, I rename it, and I move it to Evernote.

None of these steps require me to monitor the process. With a few simple tools like IFTTT, Dropbox, and Hazel, I can already automate the task.

If you’re familiar with these tools, I will share a brief summary of what we will be doing.

The main idea is to use automation service like IFTTT or Zapier to detect attachment sent to our email address, which later are saved into Dropbox. We will then configure few Hazel rules in a folder storing those files, rename each file, and run an AppleScript that move the documents — also with proper tags — into Evernote selected notebook.

Here are the list of tools and accounts you need to make the setup works:

IFTTT or Zapier account. If you’re new to automation, you can start by creating an IFTTT account for free. It also have ton of recipes you can run. You’ll be using IFTTT to be the bridge among the services we will be using in this guide.

Set the folder path to Apps/IFTTT/ so you can place IFTTT along with the rest of third party integrations that you have granted the access to your Dropbox account.

Now you have the core step implemented. Now every time you receive an email with attachments, these files will show up in the Dropbox folder. We’re not done with Gmail yet because we have to clean up those emails.

Cleaning Up Matching Emails in Gmail

If you want to automate, you should automate every step. Wouldn’t it be ideal if Gmail can automatically archive those emails with receipt and billing so they don’t fill up your inbox?

Since you know for sure who will send you those billings and invoices, you can set up Gmail filters to archive those emails whenever they arrive at your inbox. Gmail filter is a powerful feature that you can bring in your arsenal in managing emails.

From: <[email protected]>
Has the words: <the subject of the email, or the common words in the email content)
Has attachments: <check>

It can be as simple as filling From field and leave the rest of value blanks, or as complete every form fields. The main point is to create a rule that can accurately detect the emails that contain receipts and billings.

Choose Continue and enable Mark the email as read and Skip the Inbox (Archive it).

Setting up Gmail filter doesn’t stop IFTTT from detecting new email with attachments.

What can you do if you receive the attachments from different email address? IFTTT doesn’t allow you to connect to more than one Gmail channels. You can setup an IFTTT connected Gmail channel as a forwarding email address in other accounts, and once verified, you can create filters to forward emails with attachment to your Gmail IFTTT account.

Hazel Rules for IFTTT Folder

Create a new folder inside ~/Dropbox/Apps and name it Evernote. The Dropbox folder structure should look something like this:

1234

Dropbox/
Apps/
IFTTT/
Evernote/

Having a dedicated folder for each app that runs Hazel rules allows us to organize and manage the rules later. The point of separating rules per folder basis is to address a question like, “Where did I run this rules that trigger Evernote AppleScript?”

So why didn’t we just configure the IFTTT recipe to save every incoming attachment to Apps/Evernote/?

Remember that not all attachments saved inside Apps/IFTTT will be sent to Evernote. Sometimes you want to move the attachments to Downloads or Desktop. IFTTT folder is the main repository that decides where the attachments or files must be dispatched.

Now that the folders are available. Drag IFTTT folder into Hazel and create a new rule called “Move to Evernote”. The rule does only one thing: move any matching files to Apps/Evernote/ folder.

The screenshot above shows how I use the standard filename and insurance number to decide when to move these attachments to Evernote folder. Unless the attachments meet the rules conditions I set, they will stay inside IFTTT folder for other rules to process.

Moving forward with IFTTT folder, you can come up with another rule such as “Move to Download”, “Move to OmniFocus”, or “Move to Things” where each folder can run their own AppleScript.

Hazel Rules for Evernote Folder

If you have come this far, try to send an email with attachment to your IFTTT Gmail account, and see if the attachment is saved to Evernote folder. Remember to force trigger the recipe if you don’t see it appear immediately.

Make sure you can find the attachments in Evernote folder. If the attachments are still inside IFTTT folder, you need to preview the rules you configured for IFTTT folder.

Great! Now there are only a few steps left to complete our setup. You will have to do a several things here:

Decide the final filename format.

Create a rule to detect the attachments.

Create an action to rename those attachments into the final filename format.

Create an AppleScript action import these attachments into Evernote.

Move these attachments to Trash.

There are no rigid rules when it comes to naming these attachments. In my case, I prepend the service name with imported date. Here are some examples of how I name them:

The rules are fairly self-explanatory. If the notebook Billings doesn’t exist, it will create one on your behalf, and followed up by adding a new note from matching attachments. It will also delete the attachments once they are imported.

The most important thing is the notebook name which you must replace with your notebook name. Remember why I told you each service needs their own rules? Sometimes you want to save the attachment in a different notebook — billings, receipts, or shared notebook. You can get this setup by creating a new rule that detects only the files you want to move to a different destination.

Now, try to copy some attachments into Evernote folder. Preview and run the rules to see if they’re imported successfully into Evernote. If you can see them in Evernote, the setup is complete.

By now every step should be ready. You should forward some emails with attachments to your IFTTT Gmail account and see if you can find the attachments in Evernote. Trigger the IFTTT recipe manually if you don’t see the files in your Dropbox.

If you find this guide useful, please share it with your friends. Send me an email if you have any questions about this setup.

Related Posts:

Get my book for FREE! I’m writing a book about Keyboard Maestro where you can learn to automate common tasks with Keyboard Maestro macro examples. Subscribe to receive the book when it launches. More details »