applescript – Entering password through keystroke fails

Spread the love

I was automating password entry for an application using shortcuts,

First used shortcut action,

Open application_name

then wrote AppleScript,

on run
    tell application "System Events"
        keystroke {return}
        delay 2
        keystroke "password"
        delay 2
        keystroke {return}
    end tell
end run

but it gives me authentication failed.

And when I type the same password manually, then authentication succeeds, is there an alternative to using keystroke?

Author: Dhanraj7978

Leave a Reply

Your email address will not be published. Required fields are marked *