08 March 2012
Over the years, I’ve used several Mac app to track my time while working — On the Job, TrackRecord, Billings,… you name it. The main problem I’ve had with all of them is remembering to enable the timer as I work. Sometimes I’d end the day, only to realize I hadn’t tracked any of my time.
Recently, we’ve started using the online service Harvest, which comes with its own desktop app for the Mac. It’s fine, but like the others, doesn’t solve the problem I have in remembering to start the timer.
Finally, with the help of Makalu’s system administrator shell scripting wizard Niall, I have a solution.
For a long time, I’ve been a heavy user of Keyboard Maestro — an app that lets non-programming pointy-haired bosses like me, create scripts to automate their Macs. Ugly website, but a great product. Here’s some cool things I do with Keyboard Maestro:
And now, with Keyboard Maestro, I’ve solved the problem of remembering to turn on my timer.
Harvest provides an API that developers can use to interact programatically with the service. One of the actions available to Keyboard Maestro scripts is to run a shell script, and act on the results.
I combined the two to create a script that runs every 5 minutes beteween 8:30 AM and 7:30 PM, sending a request to the Harvest API, and checking the response to see if a timer is active. If a timer is not active, I growl an alert to myself and switch into the Harvest app.
So far, this solution has worked great for me!
If you’re interested, here’s a visual of the script: