How to create a dialog box for username and password

Hi,

I would like to create a dialog box that prompts the user for username and password with a OK and CANCEL button. The OK button will then pass control to a perl script to mount various SMB shares, setup printing etc…

I have found lots of references how to create a dialog box with only 1 text field on it, but I would like to have both fields on the one dialog box.

Could someone please point me in the right direction please.

Thanks.

Hi,

You would have to make a panel in IB and then call that with:


display window "thewindowname"

if the button returned of the result is "OK" then

set username to contents of text field "nametextfield"
set passwordd to contents of text field "passwordtextfield"

--do whatever you want

else
close window "thewiindowname"
end if

This will not check the username and password. It stores the username in “username” and the password in “passwordd”.

It should work :slight_smile: