|
#1
|
|||
|
|||
Display clipboard data using internet explorer
Hi,
I need some assistance for achieving following goal- -->Ask user to copy the list of commands to be executed (working) -->Display those commands using message box & ask user for the confirmation.(working) The issue I'm facing is, when user copies the more then 50 or some commands, message box is not able to display all of them(may be due to limitation of message box length) & hence user is not getting VbYesNo prompt. So,I need to achieve using internet explorer object if someone can help me with that. |
#2
|
|||
|
|||
Hi kamal,
Thanks for the question. The scripting manual has some general information about how you can use the IE object and HTML to accomplish your goal in chapter 6.3. You can find the scripting manual at the following location: http://www.vandyke.com/support/tips/...ing/index.htmlPlease note that since I am not an HTML expert, the HTML part of your goal will need to be researched elsewhere unless there is someone in this community that can assist. |
#3
|
|||
|
|||
![]()
Hi,
Your response does not help much. :-( Can you suggest any other method to display text of more than 50 lines using message box like functionality? |
#4
|
|||
|
|||
Hi Kamal,
If you don't want to modify the example in the scripting manual to meet your needs, you could use multiple message boxes. One way to do this would be to split the data into an array and find out how many elements are in the array. Then you can message box a subset of elements that you know will fit until you have displayed all of the elements of the array. Does this sound like it might work for you? What version of SecureCRT are you using? |
#5
|
|||
|
|||
Example:
Hi,
I have secureCRT v 7.1.1. Here is the snippet from my script, where user is being prompt for confirmation of the commands he copied to clipboard, since, sometimes we have more than 50 commands to run, the messagebox does not display them all & hence no VbYesNo button. So if you could share the example to do the same using IE, I would appreciate it. Since I have gone through the tutorial you shared as well as other POSTs in the forum, but not able to find the same-to display clipboard content in IE. #$language = "VBScript" #$interface = "1.0" crt.Screen.Synchronous = True Sub Main If crt.Session.Connected Then crt.Session.Disconnect crt.Session.Connect "/SSH2 /L XXXX /PASSWORD XXXX" & "z.z.z.z" crt.Session.Config.SetOption "Color Scheme", "Traditional" 'Turn off logging before setting up our script's logging... If crt.Session.Logging Then crt.Session.Log False 'Prompt User whether he wish to generate separate log files or combined one If crt.Dialog.MessageBox("Do you wish to generate combine log file? " & _ vbCR & vbCR & "Press yes to continue, No to generete seperate log file" , "Logging Options:" , vbYesNo) = vbYes Then LogPrompt = True Else LogPrompt = False End If 'If Condition for Combined logging is true If LogPrompt = True Then crt.Session.LogFileName = "C:\Users\XXXX\Desktop\Logs\%Y-%M-%D--%h-%m-%s-Combined_Logs.txt" Crt.Session.LogUsingSessionOptions End If 'Read the commands to be executed from ClipBoard & if null throw error If Trim(crt.Clipboard.Text) = vbcrlf Then crt.Dialog.MessageBox "No text found in the Windows Clipboard." Exit Sub End If 'Prompt user for confirmation of selected commands to run If crt.Dialog.MessageBox("Following Commands will be executed " & _ vbCR & vbCR & crt.Clipboard.Text, "Command List:" , vbYesNo) <> vbYes Then _ Exit Sub |
#6
|
|||
|
|||
Hi kamal,
Thanks for the information. Another option came to mind. You could take the data from the clipboard, make a copy of it, and replace all CRLFs with a different separator. That would allow you to display all of the commands in a shorter space. So to recap, in addition to the option above, you could modify the example in the scripting manual to meet your needs or you could use multiple message boxes. |
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|