Jump to content

Absolute Newbie - nothing happens?


Recommended Posts

I am just getting started with this product, and my needs are extremely basic.  I'm sure there are more efficient ways to do what I'm doing. 

That being said, I have what I feel is a pretty basic script, but when I run it, it doesn't seem to do anything, and the tray icon merely shows "Script Paused."  Nothing I do seems to unpause this. 

The concept here is to run a file, use tab, space, and enter to get some data entered, and close the file.  Doesn't appear to be doing anything. I added another set of quotes to the path name, not sure if that's needed or not. 

 

You can shred my script, I don't mind.  I attempted to do some basic debugging but I must be missing something in the help files.  I was hoping to at least determine where it was getting stuck.

 

#cs ----------------------------------------------------------------------------
 AutoIt Version: 3.3.14.5
 Author:        
 Script Function:
 Template AutoIt script.
#ce ----------------------------------------------------------------------------
; Script Start - Add your code below here
Run('"C:\Program Files (x86)\SDI\TN3270.exe"') ; Run Program
WinWaitActive("Welcome to TN3270 Plus 4.0")  ; Wait for License Screen
Send("{ENTER}")
WinWaitActive("TN3270 Plus - Product License") ; Bring up Screen with License Key
Send("Company")
send("{TAB}")
Send("License Code")
Send("{TAB}")
Send("{ENTER}")
WinWaitActive("Connect to Host - TN3270 Plus") ; Remove annoying connect screen
Send("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}")   ; 6 tabs to get to connect box
Send("{SPACE}")         ; Send space to uncheck show connect dialog
Send("{TAB}")          ; Tab to the Connect Box
Send("{ENTER}")         ; Connect just to register the box bc TN3270 is weird
WinWaitActive("TN3270Plus","Please enter a name"); This pops up when you try to connect to an empty window
Send("{ENTER}")
Send("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}"); 8 tabs to the cancel button
Send("{ENTER}")
Send("!o")          ; alt-o for file menu
Send("x")           ; This should close the program

 

 

Link to comment
Share on other sites

  • Developers

Add the following line at the top, run the script and hover over it systemtray icon to get information which line is waiting:

Opt("TrayIconDebug", 1) ;0=no info, 1=debug line info

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Moderators

@Conine WinWait and WinWaitActive both have a timeout parameter. Rather than a blanket sleep which is then going to continue the script, best practice would be to wait for the window to become active (specifying how long you with to wait), and then based on the return (0 if timeout occurs) put in logic as to how to handle this.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Alternatively, if you look at the TN320 Admin Guide: http://www.sdisw.com/tn3270/manual/index.html it tells you how to pre-configure one system and then just copy those configuration settings to each user, for the license, look at the section "Moving the License Code File" which tells you the path where the license file is located, since it's a global path you would only have to do this once, during the installation i.e. add the tn3270.ini file to an MST while deploying or use a script to copy the file to @CommonAppData\SDI\TN3270 Plus.  Alot cleaner than using send functions.

Link to comment
Share on other sites

13 hours ago, Subz said:

Alternatively, if you look at the TN320 Admin Guide: http://www.sdisw.com/tn3270/manual/index.html it tells you how to pre-configure one system and then just copy those configuration settings to each user, for the license, look at the section "Moving the License Code File" which tells you the path where the license file is located, since it's a global path you would only have to do this once, during the installation i.e. add the tn3270.ini file to an MST while deploying or use a script to copy the file to @CommonAppData\SDI\TN3270 Plus.  Alot cleaner than using send functions.

Great response.  That was actually what got me started on this entire endeavor.  I was initially doing this type of thing, but I would manually do it on the image.  When I decided to go for the holy grail - full automation - that's when I began experimenting with AutoIT to accomplish that.  My initial thoughts were that just hitting the buttons would be simpler, but the method you describe would definitely be cleaner and preferred.  Moving files around seems a bit more daunting than the key commands, which seemed so easy to use in the tutorial.  I will have to consider just scripting the file copies.  

 

Link to comment
Share on other sites

17 hours ago, Jos said:

Add the following line at the top, run the script and hover over it systemtray icon to get information which line is waiting:

Opt("TrayIconDebug", 1) ;0=no info, 1=debug line info

Jos

Thank you - that's going to help me a lot for debugging in the future. 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...