Using Keyboard Maestro to Trigger Target Display Mode

I’m still using my now-ancient 2013 iMac in Target Display Mode as my primary monitor for work-from-home. Due to some muscle issues, I’ve switched from using Apple’s keyboards to using the Kinesis Freestyle Edge split keyboard with its tenting kit. I also invested in a basic USB 2.0 ‘switching’ hub so I can flip the keyboard between my iMac and MacBook Pro.

The problem: ⌘+F2 doesn’t trigger Target Display Mode from the Kinesis keyboard. I don’t want to have to keep pulling the Apple Magic Keyboard out of the drawer to switch the display.

Solution: I created a Keyboard Maestro macro that sends this AppleScript command.

tell application "System Events" to key code 144 using command down

I’m triggering it by the same ⌘+F2 hot key that should natively work.

Since my iMac is still on Mojave, there are some known bugs with Accessibility permissions. I ended up having to restart the Keyboard Maestro Engine a few times while cycling the Accessibility permissions in the Security & Privacy Preference Pane.

The irony of lossy AirPlay2 finally having a robust ecosystem, and Apple Music introducing lossless content.

I think I just heard Here In Your Bedroom by Goldfinger in the background of a Wild Kratts episode???

I’m realizing all of my coffee mugs have their messages written on the side for me to see, when I really want to broadcast the message to my zoom meeting colleagues. We need to reverse the coffee mugs in this pandemic age! Or I could just drink left-handed.