Sign in to follow this  
Followers 0
anystupidassname

determining window ready for input

3 posts in this topic

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#.......

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thanks but sorry, I tried and that wasn't it...

Edited 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#.......

Share this post


Link to post
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
Sign in to follow this  
Followers 0