Jump to content

Recommended Posts

Posted

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

Posted

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

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

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
  • Recently Browsing   0 members

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