Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Notices

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-01-2013, 07:55 PM
bainkaboom bainkaboom is offline
Registered User
 
Join Date: Nov 2013
Posts: 1
Dialog Prompt cancelling?

I'm developing a script through python. i'm trying crt.Dialog.Prompt and when I press cancel the script stays running... I want to be able to close the script so that way if i decided at the time of input ,to cancel and i want to run again, i don't need to go into the Menu > Stop script before relaunching.

Thanks

Sample code:
DARinQuestion = crt.Dialog.Prompt("Enter " + alarmingaddress, "IP to Device", existingclipboard, False )
Reply With Quote
  #2  
Old 11-02-2013, 02:56 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,636
Hello bainkaboom,

Cancelling the prompt itself is not going to cancel the script unless you put in code to handle that situation.

As shown in the SecureCRT help topic Scripting / Script Objects Reference / Dialog Object:

Quote:
If the user clicks OK, Prompt returns the entered string; whereas, if the user clicks Cancel, Prompt returns an empty string.
So you might code something similar to the example shown in the Help:

Code:
DARinQuestion = crt.Dialog.Prompt("Enter " + alarmingaddress, "IP to Device", existingclipboard, False )

if DARinQuestion == "":
    crt.Dialog.MessageBox("Canceled")
else:
    crt.Dialog.MessageBox("Connect to " + DARinQuestion)
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
Reply

Tags
prompt dialog crt

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 03:15 AM.