koushik Posted June 25, 2008 Share Posted June 25, 2008 Here is a working code for a function i wrote. CODE Func WaitTillLoad($title) while True $text = ControlGetText ( $title, "OK", 2 ) sleep (20) if $text == "OK" Then Return EndIf Wend EndFunc This works fine - but it polls constantly for the change of the text in the control. Is it possible to achieve teh same functionality with some event mechanism?\ Cheers Koushik Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 25, 2008 Share Posted June 25, 2008 Here is a working code for a function i wrote.CODEFunc WaitTillLoad($title) while True $text = ControlGetText ( $title, "OK", 2 ) sleep (20) if $text == "OK" Then Return EndIf WendEndFuncThis works fine - but it polls constantly for the change of the text in the control. Is it possible to achieve teh same functionality with some event mechanism?\CheersKoushikPerhaps you could check for this control with an AdLibEnable() function. That would allow your script to get other things done while periodically checking for this control. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
koushik Posted July 1, 2008 Author Share Posted July 1, 2008 Perhaps you could check for this control with an AdLibEnable() function. That would allow your script to get other things done while periodically checking for this control. AdLibEnable() also would result in polling - which would be less frequent than the polling involved in the given code - but is there something totally event based?The GUI event mode mentioned in the help file - is it of any use?ThanksKoushik Link to comment Share on other sites More sharing options...
ResNullius Posted July 1, 2008 Share Posted July 1, 2008 AdLibEnable() also would result in polling - which would be less frequent than the polling involved in the given code - but is there something totally event based?The GUI event mode mentioned in the help file - is it of any use?ThanksKoushikThe Gui OnEvent mode is for GUIs you create.I'm guessing that your function is waiting for an external program window to load, not an AutoIt Gui?Give us some more information (about the program you're waiting for) and we might be able to help... Link to comment Share on other sites More sharing options...
koushik Posted July 10, 2008 Author Share Posted July 10, 2008 The Gui OnEvent mode is for GUIs you create.I'm guessing that your function is waiting for an external program window to load, not an AutoIt Gui?Give us some more information (about the program you're waiting for) and we might be able to help...The OK button is created in the window based on whether the page is loaded or not. So when the ok button is available I can retrieve some information which is loaded.Get me? Link to comment Share on other sites More sharing options...
Skruge Posted July 10, 2008 Share Posted July 10, 2008 If there's no other instance of "OK" in the AutoIt-detectable text of any controls, a simple WinWait($title, "OK") would work. [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] 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