Ventura + Keyboard Maestro + iCalBuddy = Confusion

  • Mike
  • November 17, 2022

Early this year I setup a bunch of calendar related automations with my Macs, Keyboard Maestro, and the iCalBuddy script and they’ve been very successful. I have a button on my Steam Deck that shows when my next meeting is, and I have serval automations triggered when I’m currently in a meeting such as turning on a red light outside of my home office door.

Here’s what I wrote back in March:

Anyone who’s been reading my recent posts won’t be surprised with the foundational pieces of the new automated solution: Keyboard Maestro and my Stream Deck. My solution was heavily inspired by TJ Luoma’s setup described on GitHub two years ago, and my goals were to build off of his Stream Deck display to give myself the same glanceable info on my next meeting, simplify the setup, and add the hooks to automate turning my DND red light on and off automatically when my meetings start and end.

TJ’s solution is based on iCalBuddy (note), eight KM macros, and two external bash scripts, which he uses to setup his Stream Deck to show a button that always shows when the next meting is and changes color as your next meeting gets closer. My solution does that the same and uses iCalBuddy (TJ’s same iCalBuddy version), but no external scripts, and only two KM macros:

  1. A KM macro that runs every minute and updates a button of your choosing with when the next meeting starts.
  2. The other KM macro just opens Fantastical when you press the same configured button.

Everything was great until I upgraded to macOS Ventura and then I noticed that none of that stuff worked any more. My Steam Deck button kept telling me my schedule was clear, and while that is a nice thought, that button was a little smiley liar.

The problem ended up being with the new service permission system in macOS Ventura, specially the fact that applications need permission to read from your calendar. The other problem is that it’s not at all clear how to fix this, or even debug it if you don’t know where to look.

The confusion arises from the different layers: iCalBuddy is run via a shell script within Keyboard Maestro. When you run the shell script in the terminal it may or may not work, but that’s based on if Terminal has calendar access, but the script is run from within Keyboard Maestro, then Keyboard Maestro is the app that needs to be allowed to access the Calendar.

Confused yet?

There’s more.

The answer is that you need to get Keyboard Maestro to ask macOS if it can please see your calendar data…but how do you do that? It’s also not clear. The answer is to make a Keyboard Maestro macro that uses the calendars, but a shell script won’t work because that’s what we started with!

Ok, enough. Here’s the solution:

🛟 Download the Request Calendar Access macro.

The macro does two things, and the latter is only there to confirm that the first one worked. The key is to use AppleScript to ask the system to use the Calendar. You don’t even need to actually do anything with the data, just asking “Hey, macOS do you have calendars?” will do the trick. At that point you’ll get a prompt that requests your approval for Keyboard Maestro to use the calendar data and you’re all set. The last part is an example iCalBuddy command that should then return you something instead of the previous nothing.

We did it!

Oh, crap. I’m late to a meeting!

Related Posts

A Fully Automated Home Office DND Solution

It was almost two years ago when I created a custom “Do Not Disturb” button for my home office that allowed me to tell my family that I’m in a meeting and please don’t casually pop in. I wrote a post about it, but the up shot is that I cobbled together some parts I had around, 3D printed a case, and wrote some code that so that the button, connected via USB to my computer, would act as a keyboard and fire a keyboard shortcut.

Read more

A Decade of Clojure at Studio71

  • Mike
  • March 30, 2023

What is Clojure and why did it fit for Studio71? Clojure is a programming language (a dialect of Lisp) that excels at concurrency and data processing. Clojure runs on top of Java so it’s runs in all of the places Java runs and can use all of the Java libraries already out there (hello, Google and AWS libraries!

Read more

The macOS Privacy Settings Deleted My Backups

  • Mike
  • February 13, 2023

The other day I logged in to my NAS to find that all of my backed up media files were gone. No errors, the drives were fine, the directory was there, but the files were gone. Thankfully it wasn’t a freak out moment as I had my originals and my other backups, but it was a mystery.

Read more