Unlock Screen action sending excess keystrokes

I use the Unlock Screen action in a named trigger and sometime in recent (one of the past several) updates of BTT, it has started

  1. frequently failing to cleanly execute the passphrase keystrokes and so failing to unlock the screen
  2. sending additional keystrokes after successfully unlocking the screen which then have the effect of causing strange things to happen in existing windows on the screen.

Is there anyone else using this action who has seen similar?

Is this reproducible on someone else's box or is it just me?

which version of macOS are you on?
(There haven't been changes to that action in since quite some time, but possibly newer macOS require some changes)

I'm on Sequoia 15.7.9 (Intel Imac Pro)

just got a new mac studio (M5 ultra) running Golden Gate 27 and it’s even worse on this box. It fails every time to unlock the screen. And the way it fails (though i can’t see the actual characters that are being sent) makes me think a couple things:

  1. it seems like it tries to send the password multiple times.
  2. my passphrase for unlocking my box includes spaces and it seems like maybe under some conditions it’s only sending the characters up until the first space.

It seems to work fine on my machine but I don't have spaces in my password. I'll check with spaces later!

What trigger are you using to execute the unlock action? Maybe some modifier key being held is causing issues?

i have it in a named trigger that is executed via a BTT webhook.

I've currently replaced the unlock action with this shell script action which is working well:

# Wake the display
caffeinate -u -t 1

# Wait 2 seconds for the screen to turn on
sleep 2

# Force focus onto the login window process and inject the password
osascript -e '
tell application "System Events"
    tell process "loginwindow"
        set frontmost to true
    end tell
    delay 0.5
    keystroke "YOUR_PASSWORD"
    key code 36
end tell'