Password Masking - Hide Input...

Hi Folks,

is there a way to mask a password in as?

if pin_card does not contain "Ready" then
			tell current application
				set theAnswer to text returned of (display dialog "Bitte den Pin eingeben..." buttons {"Cancel", "OK"} default answer "")
				set xstr to "at+CPIN=" & theAnswer & return
				serialport write xstr to portRef
				delay 1
				set pin_read to serialport read portRef
				delay 1
				if pin_read contains "ERROR" then
					display dialog "PinCode wurde falsch eingegeben!" & return & "Bitte starten Sie das Programm neu" & return buttons {"OK"}
					quit theApplication
					delay 1
				end if
			end tell
		on error number -128
			display dialog "Sie haben keinen PinCode eingegeben! Das Programm wird geschlossen" & return buttons {"OK"}
			quit theApplication
			delay 1
		end try
	end if

I am checking the PinCode of the SimCard in my Application and I don´t want the User to see the PinCode while entering it… I have seen that it is possible to have a Osaxen, but I would prefer to handle this without an extra Scripting Addition…

Thanks for any tipps and tricks…


Add “with hidden answer” to this line:

set theAnswer to text returned of (display dialog "Bitte den Pin eingeben..." buttons {"Cancel", "OK"} default answer "" with hidden answer)

Are you in OS 10.4?? This may be a Tiger addition.

It is.

Hi Matt-Boy, Hi Adam,

thanks for your reply and your help - its working great with Script Editor - I tried the
same in Xcode and got a failure when I try to build my application…

I will try to fix it… :slight_smile:

Thanks for your time!


Model: iBook G4 with 1.2GHZ
Browser: Safari 419.3
Operating System: Mac OS X (10.4)

Or you could just search the forums: ‘Hidden Answer’, in AppleScript Studio

Hi Bruce,

thanks for the hint! I was looking and searching for “hidden input”… :frowning:

Best regards,



Creating a window with a text box is not the solution I am looking for - the pinCode should only
be entered if a pin is on the simcard…

I could open the window if the sim is protected by a pin code…

This will be the only solution…

Thanks for your time…


Hi Folks,

I have tried now with a window - its working, but the problem in my application is, that the script is running while I have to enter the password - So I come to a point where the password should already be entered…

I haven’t found a solution on solving this, so I decided not to mask the password…

Thanks for your time!

Best Regards,


You have made a very poor decision. Do not do this.