We use Harvest to track our time. As a team lead, I will often have multiple projects or tasks that I need to log. Between interviewing, helping with sales, 1:1s, and sometimes work on multiple projects, I can log up to 7 or so different things in a week, often switching between them several times a day.
The Harvest app for OS X lacks good keyboard shortcuts for quickly switching tasks, so I set out to build my own.
The end result is that I can hit
;+h (also known as Hyper-H with my setup,
more on this later) followed by another letter to switch to a Harvest task. If
the task was already started today, it will resume it, otherwise it will start
a new task.
Install Keyboard Maestro. It’s not free, but it has a long trial, and it is well worth the money.
Install the hcl gem. I use RVM, so, I installed the gem to my system ruby in order to simplify things.
- Add these scripts somewhere. They do not necessarily need to be in your path because you will specify the full path within Keyboard Maestro.
- List your tasks with hcl. This will require you to login to your Harvest account.
Make note of the two numbers by the tasks you will want to add keys for.
Using the Keyboard Maestro Editor, create a Group called “Harvest”.
Add a new Macro. Give it a name after one of your tasks, but prefix it with a single capital letter you’d like to be your hotkey for it. Example: “I - Internal Meetings”.
Assign a hotkey. You will use the same hotkey for all of your macros. One of the great features of Keyboard Maestro is that it will display a menu if multiple things have the same hotkey and allow you to hit a single letter to choose which one you want. I use ^⌥⇧⌘H, though I have my ; key bound to ^⌥⇧⌘ (Hyper), more on that later.
Add an “Execute Shell Script” action to your macro. Set it to “Execute text script” and “display results briefly”. Call your
hcl-startscript, using the project id and task id that correspond to this task:
Repeat for your other tasks.
Add a stop task, I use “Z - Stop Timer”. Everything will be the same, but you’ll call
- Try it out. Hit your key, followed by the letter of the task you want to start. You should see a notification after a second or two (the harvest API isn’t exactly fast).
Bonus Material - Hyper Key!
I’m sure you’ve all thought, ok, I have command, ctrl, option and shift. That is not nearly enough modifier keys, Amirite?! I find it’s very useful to have a modifier key that no other apps can use for global hotkeys. Hyper fits the bill. There is a great article on many things keyboard related, including Hyper here, so I will spare you the details and cut right to the chase.
I use ; as my Hyper key, but only when it is held. If I just tap ; it comes out
as a ;. I do this using another piece of excellent keyboard customization
software, Karabiner. Install it, add this to your
“Reload XML”, and check the new box it added.