Screen Sharing Login Screen 'Insert Text By Typing' not always working

Are you typing that password into a KM prompt? You could gather it in the AppleScript itself, if you're worried:

set myPass to text returned of (display dialog "Enter your password:" default answer "" with hidden answer)

Downside compared to gathering it in KM is that you can't ask multiple questions in a single dialog, so you can't eg select a target machine and provide a password in one go.

You can limit the "exposure" of the local variable by clearing it as soon as you've got it into your AppleScript:

image

Even with other actions in-between gather and use, if someone manages to exfil Local_myPass in the second or less it exists -- you've probably got more serious issues to worry about! :wink:

For multiple use -- eg unlocking the remote machine then later in the macro do something else that needs authentication, look at pulling the password from Keychain or your password manager every time you need it -- there are certainly examples for the "Set Variable to Keychain Password" action and the 1Password password manager on this Forum, and maybe others.