Macro Fails to Run on the Password Field in Mojave

... but does so seamlessly in Mavericks and Lion. The macro is in the image. The trigger is any active application: whenever the Keychain Access' prompt to enter my Mac user password appears the macro inserts all the required fields for me. In KM 6 and 5 it's buttery smooth. In KM 9 (Mojave) when the application "SecurityAgent" becomes active the macro stalls unless I switch back to KM editor: it then types in the password but halts abruptly, and very often it does nothing at all. I know it's running because it brings "SecurityAgent" to the foreground until I disable the trigger, it's just it stops short of doing the actual tasks.

In case you're wondering what the second AppleScript script is for, it checks for the number of text input fields in the prompt: sometimes those appear for both the password and user name, other time it's only the password.
I know about the security implications in the latest releases of macOS but does that mean there's no workaround to make it work as I want it to?

Ok, this one resolves in an unexpected yet obvious way:

  1. The button name's case wasn't correct: should've been "Always Allow" (the last word capitalized)

  2. As of Mojave, automated filling of secure text fields not allowed while in older versions it was. Bummer. So, that's it, it's the dead end. Strange, nobody pointed that out here. Here's the KM knowledge database article: Secure Input Problem