display secure dialog with password field....

sorry for a n00b question but does anyone know how i can display an input dialog with a password field?
I mean like what this…

display dialog "Enter a password:" default answer "(this should be hidden in °s)

but how do i make the text field a secure text field?
thanks! :smiley:

Hi,

in Interface Builder select the text field and choose in the tab text field identity of the Inspector NSSecureTextField

that seems to only change things in the nib interface, i am using a DIALOG (like display dialog)

It’s not a window made in interface builder, it’s code. i need something like this:


display dialog "Enter Your Password:" default PASSWORD "this is hidden in dots"

thanks if you can help, im sure i have seen this somewhere…

Hey man, this is AppleScript Studio,
unless plain AppleScript with its limited capabilities
you are completely free to create whatever you want e.g. a custom window with
one or two buttons and a secure text field :wink:

I trid that but i have loads of complex variables that don’t seem to be carried from a onClicked to a finishEditing so if i use a dialog i don’t need to exit the handler.
I will ask the folks in AppleScript OS X

I guess, you have to create a custom dialog window, because
there is no hidden answer parameter in AppleScript Studio’s display dialog

using terms from application "Finder"
	set myPassword to (text returned of (display dialog "Enter password..." default answer "" with hidden answer))
end using terms from

It really is best to create your own panel and use that instead, regardless of how much more work that requires of you.

THANKS! that is perfect! :smiley:

why do you think that?