Friday I made another step towards ditching Evernote, which has been my green elephant in the room for quite a while. Whenever I start a new project I run a little Applescript that sets up a few standard folders, note files and tasks, depending on the type of project (client project, internal, etc.). Folders and template files would be in the file system, tasks in Things, and note files in a specific notebook and with tags in Evernote. The note files are now being created as markdown text files on my filesystem, with the right links and tags put into the files.

The toughest thing to crack will be how to deal with existing notes. Not adding new stuff to Evernote is one thing, but dealing with archives another. I took a few samples and a lot isn’t of much use anymore obviously, but other things might be of interest. Finding those is the challenge.

Wrote a script that will cut back the time I need to do quarterly book keeping and VAT tax returns. It takes bank journal entries and creates the right procurement journal entries from it. An earlier script automates pulling transactions from my online banking environment and put them into my banking journal. These two steps are the most time consuming in doing the books each quarter. As in the coming week I will do the 4th quarter books of 2018, I will find out soon how much time exactly it will save me.

I’m trying to do weekly small hacks this quarter. This week I did three. One because I came across it in my feedreader, and two because they were of immediate practical use this or next week. So I’m slightly ahead of schedule with 5 hacks in 3 weeks.

I do the bookkeeping for my companies myself. An old habit, started when I did the necessary training to be able to poke around in a client’s financial system over 20 years ago.
For my companies I’ve built a spreadsheet that does all the necessary things for me.

My banks provide statements in MT940 format. They assume you have some way to import them into your bookkeeping system. As I run my own spreadsheet I don’t have import functionality for that. Doing the third quarter bookkeeping recently I realised it would be good to automate adding the bank transactions. Yesterday I wrote an Applescript that takes a MT940 file and transforms it into CSV, which I can easily add to my spreadsheet.

I export the MT940 file for the period after my last download from the online banking environment, and save it as .txt. The scripts takes it, and results in a .csv file of the same name.

MT940 presents the transactions per day like
mt940 source file

The lines :60F: and :62F: show the balance at the start and end. In between are the transactions.
Every :61: line contains an amount debited or credited. The first character after an amount is N.
These lines are followed by :86: lines that provide the description. This description can be multiple lines long, with the actual description shown between /NAME/ and /REMI/.

In Applescript I read through the lines, and create a CSV line for every transaction in the way I need it in my spreadsheet (in the form of date;month;description;amount debit;amount credit), and adding a final line of the balance at the start and end of all transactions (across the entire period in the source file). That last bit I can use as a control.

csv output from the mt940 source file above

The csv I can easily import in my spreadsheet and then copy over into the bank account journal.
Now I am curious to see if my other bank uses MT940 in the same way, or has implemented the standard differently. (I learned from my EDIFACT days that even if things are standardised there will be big differences between implementations due to interpretation and mapping internal processes and data structures on a standard.)

The applescript is available on GitHub.

My Applescript to start a new project both in my todo-app Things and my note-app Evernote throws errors for the Things part suddenly. After upgrading Things 2 weeks ago. Have the applescript hooks changed? Or the data structure of Things? Need to explore.

I use an applescript at the start of new activities. Depending on the nature of the activity (client project, project acquisition, internal, learning, personal etc), it automatically populates my folder system, my todo-app and my note taking app with the right information. Folders, standard tasks for a project, templates for documents needed, bookkeeping requirements, setting a consistent name and tag for the project across all tools etc.

I’ve finished building an AppleScript for automatically creating a Suggested Reading blogpost from my Evernote bookmarks quicker than I thought.

Mostly because in my previous posting on this I, in an example of blogging as thinking out loud, had already created a list of steps I wanted to take. That made it easier to build the step by step solution in AppleScript and find online examples where needed.

Other key ingredients were the AppleScript Language Guide, the Evernote dictionary for AppleScript (which contains the objects from Evernote available to AppleScript), the Evernote query language (for retrieving material from Evernote), and the Postie plugin documentation (which I use to mail to WordPress).

In the end I spent most time on getting the syntax right of talking to the WordPress plugin Postie. By testing it multiple times I ultimately got the sequence of elements right.

The resulting script is on duty from now on. I automatically call the script every Monday afternoon. The result is automatically mailed to my WordPress installation which saves it as a posting with a publication date set for Tuesday afternoon. This allows me time to review or edit the posting if I want, but if I don’t WordPress will go ahead and post it.

There is still some room for improvement. First, I currently use Apple Mail to send the posting to WordPress. My default mail tool is Thunderbird, so I had to configure Mail for this, which I had rather not. Second, the tags from Evernote that I use in the title of the posting aren’t capitalised yet, which I would prefer. Good enough for now though.

I’ve posted the code to my GitHub account, where it is available under an open license. For my own reference I also posted it in the wiki pages of this blog.

The bookmarks to use as listed in Evernote..


…and the resulting posting scheduled in WordPress