I was having challenges where a script that used to work for sending keystrokes directly to a window based on its window title wasn’t working. I tried troubleshooting a bunch of stuff (so weird since it was working before) but nothing was sticking.
I stumbled across a comment mentioning that programs being run as Adminstrator couldn’t be interacted with by programs that were not being run as Administrator (in this case, AHK for me).
By changing the AutoHotKey executable to always run as administrator I was able to send commands again without any issues.