cmb99 Posted September 1, 2005 Share Posted September 1, 2005 Having trouble with this script. The first block runs well. The second block is an exact duplicate of the first, but once the dialog comes up "New Login", ControlSend quits, and no text is sent. I can't figure out why the first block would work and not the second. As a test, I deleted the first block, now the second block works, but not the third. It's as if I only get one chance with ControlSend. ; Block 1 Run("C:\Program Files\Java\jre1.5.0\bin\javaw.exe -cp jts.jar;jcommon-0.9.0.jar;jfreechart-0.9.15.jar -Dsun.java2d.noddraw=true jclient/LoginFrame C:\PROGRA~1\Jts", "C:\PROGRA~1\Jts") If WinWait("New Login") Then ControlSend("New Login", "", "", "XXXX{TAB}XXXX{ENTER}", 0) EndIf If WinWait("Universal Account UXXX") Then WinSetState("Universal Account UXXXX", "", @SW_MINIMIZE) EndIf ; Block 2 Run("C:\Program Files\Java\jre1.5.0\bin\javaw.exe -cp jts.jar;jcommon-0.9.0.jar;jfreechart-0.9.15.jar -Dsun.java2d.noddraw=true jclient/LoginFrame C:\PROGRA~1\Jts", "C:\PROGRA~1\Jts") If WinWait("New Login") Then ControlSend("New Login", "", "", "XXXX{TAB}XXXX{ENTER}", 0) EndIf If WinWait("Universal Account UXXX") Then WinSetState("Universal Account UXXX", "", @SW_MINIMIZE) EndIf ; Block 3 Run("C:\Program Files\Java\jre1.5.0\bin\javaw.exe -cp jts.jar;jcommon-0.9.0.jar;jfreechart-0.9.15.jar -Dsun.java2d.noddraw=true jclient/LoginFrame C:\PROGRA~1\Jts", "C:\PROGRA~1\Jts") If WinWait("New Login") Then ControlSend("New Login", "", "", "XXXX{TAB}XXXX{ENTER}", 0) EndIf If WinWait("Universal Account UXXX") Then WinSetState("Universal Account UXXX", "", @SW_MINIMIZE) EndIf Exit Link to comment Share on other sites More sharing options...
AutoChris Posted September 1, 2005 Share Posted September 1, 2005 (edited) Why do you have the same exact code listed 3 times? Why not do something like this?; Block 1For $i = 1 to 3Run("C:\Program Files\Java\jre1.5.0\bin\javaw.exe -cp jts.jar;jcommon-0.9.0.jar;jfreechart-0.9.15.jar -Dsun.java2d.noddraw=true jclient/LoginFrame C:\PROGRA~1\Jts", "C:\PROGRA~1\Jts")If WinWait("New Login") Then ControlSend("New Login", "", "", "XXXX{TAB}XXXX{ENTER}", 0)EndIfIf WinWait("Universal Account UXXX") Then WinSetState("Universal Account UXXXX", "", @SW_MINIMIZE)EndIfNextEdit: forgot to end quote Edited September 1, 2005 by SerialKiller Link to comment Share on other sites More sharing options...
LxP Posted September 2, 2005 Share Posted September 2, 2005 You may or may not have more luck with this code (it is possibly more correct and cohesive):winWait("New Login") controlSend("New Login", "", "", "XXXX{TAB}XXXX{ENTER}", 0) winWait("Universal Account UXXX") winSetState("Universal Account UXXXX", "", @SW_MINIMIZE)P.S. Does the New Login window give initial focus to the control that wants the username? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now