I was recently debugging one of my old shortcuts that integrated with macOS to get the name of the frontmost app using AppleScript and noticed that, at some point over the past two years, that script had stopped working. I tried fixing the AppleScript myself, but after five minutes spent trying random and outdated code...