Automate Archiving Bank Statements to Evernote in macOS

I’ve been manually archiving bank statements (PDF files) to Evernote for a while. And frankly it’s taking me a fair amount of time to do it “properly”. By that I mean:

  • One statement saved in a single note.
  • Note name should reflect which card/account the statement is from.
  • Note name should reflect which period the statement is from.
  • Note should have proper Creation Date matching the statement. It helps sorting.
  • Note should have proper tags to help searching.

So it’d take much longer than just using Evernote to clip the PDF files.

And finally I got tired of it and decided to automate this.

Demo video

When I drag the downloaded statement files into the “Dropbox” folder, they get automatically archived to Evernote and then deleted from the folder.

The solution

… is fairly straightforward.

Step 1: create a Folder Action in Automator to watch new files for a particular folder.

Step 2: for each of the new files, create a new note in an Evernote notebook with that file as the attachment.

Since this is a pretty generic step, I created a Script Library for it. See Evernote.scpt in the code below.

In my case I want all statements to be in the Finance notebook and tagged with the bank info and some extra tags to help searching. I want the name of the note to be some identification of the card and the date of the statement.

Then here’s the slightly more tricky part. AFAIK, AppleScript is not particularly good at processing strings. And because I know JavaScript better, I decided to parse the statement filename in JavaScript.

What I need is the date info in the filename and make sure the filename looks like what I’m expecting. That’s what parseFilename in 2 - Parse filenames and save to evernote.js is doing.

So why do I need 1 - Get paths and filenames from aliases.scpt at all? Well, this is embarrassing. Half way into the JavaScript I realized that I can’t use nodeJs modules like path to help me with parsing the input file paths. Manually splitting the string looks messy. Eventually I learned that getting the filename from the path is very easy so I added this extra step to convert the list of aliases to a list of descriptors that have both the path info and the name info.

I encountered a strange exception here: when I tried to save the original alias into the path property of the descriptor, Automator simply crashes.

Another caveat is, given the way of reading a property from a descriptor is propName of descriptor, the property name can’t be some pre-defined keywords, such as path. So I had to change it to "thePath".

The Automator Workflow

The code

My favorite assistive touch settings for iPhone X

Here’s why:

First let’s talk about the “Single Tap”. I think by default the “Single Tap” is set to “Open Menu” which, well, opens the menu. Although I find it useful on my iPhone 8, for iPhone X I find it much better to set it to “Home” which effectively makes the virtual button the home button. And it works on the lock screen as well! You don’t need to “swipe up to unlock” any more!

I’ll leave the “Double Tap” empty. Since I made single tapping trigger home button, double tapping will be recognized as a double tap of the home button and will trigger multitasking, which works great for me.

Now let’s jump to the “3D Touch” part. Inspired by how the buttons in Control Center react to 3D touches, I feel it’s only natural to open the menu when the virtual button is “3D touch”ed. Feels really good every time when I hard-press to pop the menu open.

I could have left the “Long Press” empty as well so long pressing the virtual button will naturally trigger Siri. But since there is already a dedicated long-press-side-button action for Siri that is also convenient enough, I decided to change it up.

Long pressing on the virtual button is kinda awkward; there is no haptic feedback. So I would suggest putting whatever action that is less frequently used but is still useful. Also know that the time limit for a press to be considered a long press can be configured to be as low as 0.20 seconds, so a long press can actually be triggered really really fast! For me I think long pressing for multitasking is perfect when I’m lazy and don’t want to double tap. Another great option is for it to open the Control Center so no more stretching is needed!

I hope this helps improve your iPhone X experience!

Where I think/hope Apple MacBook is moving towards

In chronological order:

  • Good ol’ laptop keyboard.
  • Butterfly switch keyboard to reduce overall thickness of keyboard.
  • Dynamic keys with Touch Bar. (where we are right now)
  • Touch Bar with haptic feedback (Apple Taptic Engine?) to simulate key presses.
  • Touch Bar with advanced haptic feedback to allow texture on buttons (and other controls).
  • Entire keyboard replaced with OLED (or better) display with advanced haptic feedback technologies so it feels more or less the same as typing on a keyboard with butterfly switches. (This would probably appear on iPads first)
  • (Maybe at some point there will be no difference between the display and the keyboard.)