How do you mask a password in Applescript Studio

Simple I’ve got a Applescript Program with a userlogon box. How can I mask out the password as the user types it in to stop prying eyes from seeing it.

Thanks for any help

If you open your interface in Interface Builder, and press command + 5, you can select “NSSecureTextField”, which will format any input for that field into bullets. :wink:

this actually sounds EXACTLY like what I was about to do!
Dangay, would you mind posting this online once you’re done?

is it impossible to mask a password in simple applescript? for example, can i add anything to this that would cause the input password to appear as bullets in the dialog box as the user types it in?

set clientdialog to display dialog "Enter password " default answer ""
set clientpass to text returned of clientdialog

…or is it things like this that cause people to graduate to applescript studio? :slight_smile:

I’m not 100% sure, but to be able to mask out passwords in AppleScript (Not Studio), I think you would need a scripting addition. Check out, there is probably one there.

there is indeed osaxen for this:

24U Appearance OSAX 2.1

very easy to use, after downloading, making a new scripting additions folder, and looking at the sample scripts to see what they do.

the script i have now is fine for my use because i have everything i need installed, but i may just stick with the unmasked password script because i can distribute it to coworkers without making sure they have other stuff installed.

wouldn’t it be great if apple incorporated some of the osaxen abilities into basic applescript?


I want to take the input in a textField which a password and the need is to hide that in AppleScript Studio like we can do in AppleScript
as showed in the command below:
set inpassword to display dialog “Please enter Sudo Password” default answer “” buttons {“OK”} with title “Enter Password” with hidden answer
set thePassword to text returned of inpassword
Any help would really be appreciated :slight_smile: