Simplify your Receipt Collection with an Automated Inbox

Nando Rossi
4 min readDec 8, 2016

--

Scanning and sorting receipts regularly is a painful process. My folders are sorted by year and quarter, which is convenient for my accountant, but means I have to always remind myself (and update my scanning app) where the receipts go.

That means I often avoid scanning them, until theyre due and I spend half a day scanning everything that piles up. For quite some time, I’ve been looking for a way to centralize my receipt collection and automatically move them to the current year/quarter. I think I finally figured out a way.

Word of warning: if you have panic attacks when you hear words like “scripts” and “terminal,” maybe this isn’t for you. If you’re adventurous, or got some good meds, welcome aboard!

My Solution: Folder Actions

Turns out a very simple solution was right under my nose, in my MacBook. And you don’t have to install anything–Apple provides us with a neat little tool called Folder Actions.

Setting a Folder Action is telling your Mac, “watch this folder. If something happens to it, do this other thing to it.” For example:

When someone adds a file into folder A, move the file to folder B.

The difference here is, the name of “folder B” changes every month. We’ll fix that with code.

How to setup your Folder Action

There are many ways to do this. The way I did it uses another tool Apple provides called AppleScript. Four steps:

  1. Create your inbox folder
  2. Download and customize my script
  3. Copy it into your “Folder Actions” folder
  4. Run the “Folder Actions Setup” application

1. Create your inbox folder

Create your folder anywhere you want, just remember where you saved it! My inbox folder is on Dropbox:

~/Dropbox/Accounting/receipts

2. Download and customize my copy script

Get the file here. Once it’s downloaded, double-click it. You will see the Script Editor:

The highlighted part is where you’ll be inserting your folder’s path.

You’ll only have to change one line. See where it says set targetFolder to? That’s where you need to enter your destination folder.

No idea what I’m talking about? Baby steps.

Let’s use my folders as an example. This is how I’m storing my receipts:

I have a folder for the year and one for the quarter. The path for this (using colons because AppleScript) would be:

Users:nando:Dropbox:Accounting:2016:2016 Q3:Receipts

Now, here’s the cool part. AppleScript lets us specify the target folder dynamically, meaning every time it runs, it will ask: “what year is this?” and “what quarter is it right now?” and change our path accordingly.

To make things easier, I’ve created some variables: currentYear, currentMonth and currentQuarter. Here’s how that looks for my example:

Users:nando:Dropbox:Accounting:currentYear:currentYear currentQuarter:Receipts

However, we’ll need to write it in AppleScript’s way:

  • The fixed parts in double quotes “” (for example, Dropbox, long:paths or even a space between two variables)
  • The variables with no quotes
  • Ampersand between every element & (which tells AppleScript to join all those parts together)

So. How does that look on my example?

“Users:nando:Dropbox:Accounting:” & currentYear & “:” & currentYear & “ ” & currentQuarter & “:Receipts”

Still kinda busy, I know, but hopefully you got the point. Replace this with your own path and save the file.

3. Copy it to your Folder Actions folder

  • Open a new window on Finder
  • Press cmd + shift + G
  • Type: ~/Library/Workflows/Applications/Folder Actions/
  • Hit return
  • Copy the script “Move to Receipts.scpt” into this folder

4. Run the Folder Actions Setup application

  • Click on the Spotlight icon (🔍)
  • Type “folder actions setup” and hit return
  • On the left panel, select you inbox folder (created on step 1). On the right panel, select “Move to Receipts.scpt”

…and you’re all set!

Whew! From now on, all you have to do is copy a receipt into your inbox folder, and your Mac will move it to the current quarter’s Receipts folder–AUTOMAGICALLY!

Next post I’ll show you how to setup Scanner Pro to simplify your workflow even more.

--

--