Store hashed password in script

I use a Mac OS machine that is shared with other users. The testing I am doing requires me to log into another Mac and another proprietary application. I would like to know if there is a way to store my password for use by eggplant script(s) in a hashed or encrypted format, instead of spelling it out as TypeText “MyPassword”.

I have searched the help and reference material and not found anything concrete.

Thanks in advance.

There’s no mechanism for storing and encrypting/decrypting passwords. You might be able to use the shell command to make a call to a utility that can do that for you.

If you’re actually present when the script is running, then you can use the “ask password” command to put up a prompt into which you can enter a password, which will be masked. Then in the script code you can use the command

set the ScriptLogging to off

before passing the entered value to the typeText command, and neither the value nor the typetext command itself will be logged in the results. So you could do something like this:

click "passwordField"
set the scriptLogging to off
ask password "What is your password?"
typeText it
set the scriptLogging to on