Welcome to the VanDyke Software Forums

Join the discussion today!


Go Back   VanDyke Software Forums > Scripting

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-02-2018, 06:07 PM
King908 King908 is offline
Registered User
 
Join Date: Jun 2018
Posts: 6
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
Reply With Quote
  #2  
Old 10-03-2018, 08:02 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,557
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)
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730
Reply With Quote
  #3  
Old 10-03-2018, 02:59 PM
King908 King908 is offline
Registered User
 
Join Date: Jun 2018
Posts: 6
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.
Reply With Quote
  #4  
Old 10-03-2018, 03:46 PM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 3,557
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.
__________________
Thanks,
--Brenda

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


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 05:00 PM.