anystupidassname Posted August 20, 2008 Share Posted August 20, 2008 Hello all. I have a script that occasionally initiates before the java app it is supposed to interact with is ready/responding. This results in failure of the script. Could somebody please advise how this situation would be handled by a GOOD script writer (unlike me :-/)? ;grab 16 Numbers $doc4 = StringRegExp($doc3, "\d{12,16}", 1) $doc5 = _ArrayToString($doc4) ;msgbox(48,"",$doc1) ;switch to titan WinActivate("Titan") WinWaitActive("Titan") Sleep(5) ;initiate xref alt-f n x Send("!f") Send("n") Send("x") ;;tried alternative method that didn't work... WinMenuSelectItem("Titan","&File","&New","New &Xref") ;pick resource tab tab t tab WinActivate("Cross Reference") WinWaitActive("Cross Reference") Sleep(50) Sleep(50) Send("{TAB}") Sleep(50) Send("{TAB}") Sleep(50) Send("t") Thanks! This signature is computer generated, nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#....... Link to comment Share on other sites More sharing options...
Country73 Posted August 20, 2008 Share Posted August 20, 2008 Are you sure that Sleep isn't causing the problem? ;switch to titan WinActivate("Titan") WinWaitActive("Titan") Sleep(5) WinWaitActive should pause your script until "Titan" is ready. I would try removing the sleep, or maybe put in a WinActivate("Titan") after your sleep. If you try to fail and succeed which have you done?AutoIt Forum Search Link to comment Share on other sites More sharing options...
anystupidassname Posted August 20, 2008 Author Share Posted August 20, 2008 (edited) Thanks but sorry, I tried and that wasn't it... Edited August 20, 2008 by anystupidassname This signature is computer generated, nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#nothing can go wron#....... 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