VanDyke Software Forums

VanDyke Software Forums (https://forums.vandyke.com/index.php)
-   Scripting (https://forums.vandyke.com/forumdisplay.php?f=14)
-   -   Allow Script to Pause to Copy Output into Text Box (https://forums.vandyke.com/showthread.php?t=13276)

King908 10-02-2018 06:07 PM

Allow Script to Pause to Copy Output into Text Box
 
Good evening,
I thank you all for the continued support, and examples have been helpful. So my script below works. But I have to type in the information from the output into the Text Box, would like to be able to possibly copy it from the screen into the text box. Any suggestions?

#$language = "VBScript"
#$interface = "1.0"

crt.Screen.Synchronous = True

' This automatically generated script may need to be
' edited in order to work correctly.

Sub Main
crt.Screen.Send "su - root" & chr(13)
crt.Screen.WaitForString "#"
crt.Screen.Send "command to list array" & chr(13)
crt.Screen.WaitForString "#"
crt.Screen.Synchronous = False
crt.Screen.Synchronous = True

THIS PART ON SCREEN NOW SHOWS THE NAME I AM WORKING ON FOR THE NAME. I HAVE TO TYPE IT INTO THE TEXT BOX BELOW:

' Prompt the end user for data'
strAnswer = InputBox("Please enter the LESS Array Name on Screen:")
crt.Screen.Send "/opt/sun/directory command "
crt.Screen.Send strAnswer
crt.Screen.Send " disk " & chr(13)
End Sub

bgagnon 10-03-2018 08:02 AM

Hi King908,

Is the data in a specific/static location each time?

You can use Get() or Get2() as described in section 4.3 (Capturing Data from a Remote Machine) in the Scripting Essentials scripting guide available on our website here.

Note also that your three Send() calls at the end of the script can be concatenated as shown:
crt.Screen.Send "/opt/sun/directory command " & strAnswer & " disk " & chr(13)
:)

King908 10-03-2018 02:59 PM

I just checked, and the data isn't always on the same Row. The output sometimes is 19,8 through 19,34 or 20,8 through 20,34 depending on the RSA warning.

bgagnon 10-03-2018 03:46 PM

Hi King908,

Is there anything consistent in the output prior to username being displayed?

Perhaps you can use WaitForString() up until the RSA warning and then ReadString() to capture what comes next.


All times are GMT -6. The time now is 09:11 AM.