Sign in to follow this  
Followers 0
J-J

Is it possible to program a wait and execute based on upcoming text in Windows program?

3 posts in this topic

Hello, does somebody have a sample code to program a wait with some comand executions until certain text lines appear in a certain field of a Windows application?

I need to program some mouse movements and mouseclicks depending on certain lines of text appearing in a textfield of a windows application. These lines of text could come at anytime during a working day.

Thanks for your support. JJ

Share this post


Link to post
Share on other sites



If your just talking about Windows' windows then use WinGetText and WinWait . Look on your autoit help file and look to see which one would work the best, if you can say here or msg me on what you REALLY need i can help further more...

Share this post


Link to post
Share on other sites

Local $WindowName = 'Window name to the application'
Local $TextToWaitFor = 'SomeText'
Local $Control_Id_Of_TextField = 'Some Control Id - Use The AutoInfo Tool Provided To Get'

_WaitForText($WindowName, $TextToWaitFor, $Control_Id_Of_TextField)

While 1
    Sleep(10)
;Do something you would normally do if text appears
WEnd

Func _WaitForText($sWin, $sText, $Hwnd_CID)
    Do
        Sleep(10)
    Until ControlGetText($sWin, '', $Hwnd_CID) = $TextToWaitFor
EndFunc


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

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