September 29, 2015 at 11:36 PM by Dr. Drang
After a very busy few weeks at work, I have a bit of downtime as I wait for information to come in on a couple of new projects. I’ve cleaned my desk, generated a few expense reports for the travel I did, and, inevitably, thought about how I could speed up the entry of some common expense items.
I’ve done this before with TextExpander to automate the entry of mileage and tolls, but I found some quirks in the way TE snippets expand in Numbers1 cells. Also, the snippets entered only a single cell’s worth of information, and several more cells could be automated.
Here, for example, is an expense report with my typical entries for driving to and from Midway Airport. The mileage is always the same, the tolls are always the same, and the descriptions are always the same. The only things that change from one trip to the next are the dates and the project number.
So I made a macro that asks for the dates and project number and then populates all four lines of the tables.
There’s not much intelligence to this macro, but it is long:
If you’re wondering where the variable for the IRS mileage rate is defined, it’s in this other macro:
Because Keyboard Maestro variables are shared between macros, I can get away with defining it in one place and using it in another. This macro is also useful when I need to make an expense report that includes an arbitrary mileage charge. Unlike TextExpander snippets, Keyboard Maestro macros seem to expand just fine in Numbers cells, so if I drive 27 miles on a project, I can just enter
in the cell and then type ⌃⌥⌘I to enter the rate. When the IRS changes its rate next year, I’ll update the value from .575 to whatever the new value turns out to be.
I’m not proud of what I’ve done here. It’s a brute force method of automation with no cleverness to it whatsoever. But it’s going to save me time and the frustration of mistyped entries. I need to make one for the trip to O’Hare, too.