VanDyke Software Forums

VanDyke Software Forums (https://forums.vandyke.com/index.php)
-   Scripting (https://forums.vandyke.com/forumdisplay.php?f=14)
-   -   Variable Dialog Box (Secure CRT Mac - Python) (https://forums.vandyke.com/showthread.php?t=13484)

krypton179 04-05-2019 01:17 AM

Variable Dialog Box (Secure CRT Mac - Python)
 
Hi Experts,

can somebody share a way that I can launch a dialog box when executing a python script on Secure CRT to request input of multiple variables that are used within the script?

One of the three variables is sensitive (password / key) so when executing user input it should not show up when typed.

Thanks,

K

bgagnon 04-05-2019 07:33 AM

Hi krypton179,

SecureCRT has its own mechanism for this.

See Scripting / Script Objects Reference / Dialog Object. The Prompt() method supports a Boolean (isPassword) that can mask that data entry.

Quote:

Python
Syntax
crt.Dialog.Prompt(message [, title [, default [, isPassword ]]])
Example
password = crt.Dialog.Prompt("Enter your password:", "Logon Script", "", True)

if password == "":
# User clicked Cancel button
else:
# User added data



All times are GMT -6. The time now is 08:12 PM.