Automatically de/activate @computer Omnifocus tag using Keyboard Maestro and OmniAutomation

The goal

Activate or pause a tag automatically based on whether I’m at my computer.

System context

@macbookpro is the tag which I use to indicate my computer is required for the assigned actions.

In my Today List perspective I hide any actions which have a tag that’s currently On-Hold.

I’ve been lightly using an Activators project, which helps to manage my system. Previously, I had a M-F repeating action “Activate @macbookpro Tag” containing a link to that tag. It’s a fine setup but I knew there’s a better way. I tried some UI scripting with Keyboard Maestro and it worked too, but just okay.

In essence, the macro opened the tag then looked (at the screen) to see whether it was active or on-hold, then clicks the opposite status. The drawbacks here are inherent with any UI scripting; can’t touch the mouse when it’s running and everything’s subject to app interface updates or dark/light mode switching.

Current solution

I wrote a small OF plugin which gets the status of my @macbookpro Tag then toggles it to the opposite.

Then I added a layer using Keyboard Maestro to run the automation. The macro is triggered when my computer is idle for 15 mins. That handles the pausing portion. For the activating part, I wrote another macro which triggers on system wake, waits until I’ve typed my password, then runs the other macro. Sweet!

Plussing

  • I added some audible feedback by toggling a KM variable (ACTIVATE/PAUSE) then I play the MacOS sound “Funk” when it’s activated and “Bottle” when it’s placed on-hold.
  • Often I put my Mac to sleep using Alfred. I deactivated the default Alfred sleep command and converted it into a workflow, which first runs the KM macro above, then another KM macro so sleep my machine.

So far so good!

Next up, I’m going to experiment with manipulating OF data based on things like weather forecast and upcoming calendar events.

Happy dabbling!

2 Likes