Environment
NSL7.x
SetPrompt command used in SecureLogin script
SetPrompt command used in SecureLogin script
Situation
Unable to specify which credentials "SetPrompt" command prompts the user for.
"SetPrompt" command prompts the user for all mising variables, not specific variables.
"SetPrompt" command prompts the user for all mising variables, not specific variables.
Resolution
Use "DisplayVariables" instead of "SetPrompt."
SetPrompt will prompt the user for any variables SecureLogin perceives to be missing. Displayvariables can prompt for only specify variables. (Also note that it is important to place the DisplayVariables or SetPrompt commands in the correct place in the script.)
SetPrompt will prompt the user for any variables SecureLogin perceives to be missing. Displayvariables can prompt for only specify variables. (Also note that it is important to place the DisplayVariables or SetPrompt commands in the correct place in the script.)
As stated in the online documentation, SetPrompt is "...used to prompt the user for new variables. You can also use the DisplayVariables command to customize the prompt text in the dialog box (for previously stored variables)."
Additional Information
For example, the following script for yahoo.com will prompt users for just their username if they answer "no" to the question "Do you know your Yahoo password ?" and will prompt for both username and password if they answer "yes" to the question "Do you know your Yahoo password ?"
*** Yahoo script - note that this is just a partial script to show the use of the DisplayVariables command ***
MessageBox "you're in the right place"
## BeginSection: "Login Form"
Site "Sign in to Yahoo!" -initial
MatchForm #1 -name "login_form"
MatchField #1:28 -type "text" -name "login"
MatchField #1:29 -type "password" -name "passwd"
EndSite
MessageBox "Do you know your Yahoo password ?" -yesno ?result
if ?result Eq "No"
DisplayVariables "Please enter your username" $username
SetPrompt "what is your Yahoo User ID?"
FocusInput #1:28
TextInput #1:28 -value "$username"
SetPrompt "what's your Password"
FocusInput #1:29
TextInput #1:29 -value "$password"
PressInput
EndIf
if ?result Eq "Yes"
DisplayVariables "Please enter your username and password." $username $password
SetPrompt "User name - Yahoo! ID"
FocusInput #1:28
TextInput #1:28 -value "$username"
SetPrompt "what's your Password"
FocusInput #1:29
TextInput #1:29 -value "$password"
PressInput
EndIf
To use the above script,
1. Go to yahoo.com and click "sign in"
2. Let the NSL7 wizard create a script
3. Hit "cancel" when prompted for credentials
4. Launch "manage logins" on the workstaiton and edit the newly created yahoo application
5. Click the button to "convert to application definition" (don't keep debug info)
6. Replace application definition with the above script
7. Close and relauch browser, go to yahoo, click "sign in" and test.
*** Yahoo script - note that this is just a partial script to show the use of the DisplayVariables command ***
MessageBox "you're in the right place"
## BeginSection: "Login Form"
Site "Sign in to Yahoo!" -initial
MatchForm #1 -name "login_form"
MatchField #1:28 -type "text" -name "login"
MatchField #1:29 -type "password" -name "passwd"
EndSite
MessageBox "Do you know your Yahoo password ?" -yesno ?result
if ?result Eq "No"
DisplayVariables "Please enter your username" $username
SetPrompt "what is your Yahoo User ID?"
FocusInput #1:28
TextInput #1:28 -value "$username"
SetPrompt "what's your Password"
FocusInput #1:29
TextInput #1:29 -value "$password"
PressInput
EndIf
if ?result Eq "Yes"
DisplayVariables "Please enter your username and password." $username $password
SetPrompt "User name - Yahoo! ID"
FocusInput #1:28
TextInput #1:28 -value "$username"
SetPrompt "what's your Password"
FocusInput #1:29
TextInput #1:29 -value "$password"
PressInput
EndIf
To use the above script,
1. Go to yahoo.com and click "sign in"
2. Let the NSL7 wizard create a script
3. Hit "cancel" when prompted for credentials
4. Launch "manage logins" on the workstaiton and edit the newly created yahoo application
5. Click the button to "convert to application definition" (don't keep debug info)
6. Replace application definition with the above script
7. Close and relauch browser, go to yahoo, click "sign in" and test.