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 01-11-2016, 09:52 AM
teggenberger teggenberger is offline
Registered User
 
Join Date: May 2014
Posts: 15
ScriptError: Screen.Send: not connected

I recorded a simple 'login' script and saved it as a *.py file.
When i try to run the script, I get a pop-up error that shows:

'ScriptError'
ScriptError: Screen.Send: not connected
File:C:\login.py
Line: 9
crt.Screen.Send(chr(13))

here's the code:

# $language = "python"
# $interface = "1.0"

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

def Main():
crt.Screen.Synchronous = True
crt.Screen.Send(chr(13))
crt.Screen.WaitForString("Username:")
crt.Screen.Send("******" + chr(13))
crt.Screen.WaitForString("Password:")
crt.Screen.Send("******" + chr(13))
crt.Screen.WaitForString("BBDLC-N017>")
crt.Screen.Send("enable" + chr(13))
crt.Screen.WaitForString("BBDLC-N017#")
crt.Screen.Send(chr(13))
crt.Screen.WaitForString("BBDLC-N017#")
crt.Screen.Send("sho auto shelf" + chr(13))
crt.Screen.WaitForString("--MORE--")
crt.Screen.Send(" ")

Main()

Any help most appreciated.
Reply With Quote
  #2  
Old 01-11-2016, 10:03 AM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi teggenberger,

Thanks for the post.

Your script will interact with a remote device, but it won't connect you to a device. The error you are seeing is the result of not being connected while the script is running.

What version of SecureCRT are you using?

What version of Windows are you using?

Do you want to run this script manually?

If not, are you wanting to run this script automatically when you connect your session?
__________________
--Todd

VanDyke Software
Technical Support
support@vandyke.com
505-332-5730
Reply With Quote
  #3  
Old 01-11-2016, 01:42 PM
teggenberger teggenberger is offline
Registered User
 
Join Date: May 2014
Posts: 15
That makes sense, thanks.

I was thinking the script would telnet/connect to a device (i.e. start a new session).
Reply With Quote
  #4  
Old 01-11-2016, 01:53 PM
teggenberger teggenberger is offline
Registered User
 
Join Date: May 2014
Posts: 15
<answers in CAPS>
What version of SecureCRT are you using?
<VERSION 7.3.5>

What version of Windows are you using?
<WINDOWS 7>

Do you want to run this script manually?
YES; I was hoping i could run it as a standalone *.py script.
Reply With Quote
  #5  
Old 01-11-2016, 01:58 PM
teggenberger teggenberger is offline
Registered User
 
Join Date: May 2014
Posts: 15
This video shows what i'm trying to do (except using python)

https://www.youtube.com/watch?v=ltc5o9icDuA
Reply With Quote
  #6  
Old 01-11-2016, 03:47 PM
rtb rtb is offline
VanDyke Technical Support
 
Join Date: Aug 2008
Posts: 4,306
Hi teggenberger,

The video didn't help make your goal more clear.

Are you indicating that you want to replace the Windows batch script and the VBScript with a single Python script?

If so, what problem does this help you solve?
__________________
--Todd

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 10:37 PM.