BatMan22 Posted October 3, 2016 Share Posted October 3, 2016 I am trying to make a script with the command WinWaitActive where it looks for a window that changes the name.. ie. "Reprocess: xxxxxx". For example something like WinWaitActive("Reprocess:"+*****) Thanks! Link to comment Share on other sites More sharing options...
AutoBert Posted October 3, 2016 Share Posted October 3, 2016 Read about Window Titles and Text (Advanced) in Helpfile. If it's the only window beginning with "Reprocess:" you can use Opt("WinTitleMatchMode", 1) $hWnd=WinWaitActive("Reprocess:","",10) ;waiting max 10 sec for activating If $hWnd=0 Then Exit MsgBox(16,"Error","Window not found") or you can trying to do it by matching Title defined by a regular expression. Link to comment Share on other sites More sharing options...
BatMan22 Posted October 3, 2016 Author Share Posted October 3, 2016 Sorry man, first time programming in decades, you will probably laugh at my script but... It's super simple, fast, it works and its saved me a TON of time. Thanks for your help! I don't honestly understand why WinWaitActive("Reprocess:","") means Reprocess: *****, but your code works great. Which the error box is great.. If I DIDNT want to put in the timeout delay... Could I replace it with JUST WinWaitActive("Reprocess:","")? Either way, thanks a ton! $repeat = inputbox("Beep", "how many times should it repeat?", "") While $repeat ;repeat $number of times Sleep(100) WinWaitActive("Chromatogram open") Send("!B"); send to batch WinWaitActive("To Batch") Send("!K"); hit ok WinWaitActive("IC Net") Send("!Y"); hit yes Opt("WinTitleMatchMode", 1) $hWnd=WinWaitActive("Reprocess:","",10) ;waiting max 10 sec for activating If $hWnd=0 Then Exit MsgBox(16,"Error","Window not found") Send("!O"); Go to Report Options WinWaitActive("Report options") Send("!U"); Go to Custom Report Text bot Send("export.exe") ; type export.exe Send("!A"); Hit the accept button Opt("WinTitleMatchMode", 1) $hWnd=WinWaitActive("Reprocess:","",10) ;waiting max 10 sec for activating If $hWnd=0 Then Exit MsgBox(16,"Error","Window not found") Send("!R"); Hit the report button WinWaitActive("IC Net") Send("!FOC"); OPenChromatogramWindowAgain WinWaitActive("Chromatogram open") Send("{DOWN}") $repeat -= 1 wend MsgBox(1,"Reported","OK") Link to comment Share on other sites More sharing options...
jdelaney Posted October 3, 2016 Share Posted October 3, 2016 (edited) Get the handle...it doesn't change, even when the title does: $h = WinGetHandle Then you can loop until the title changes: WinGetTitle( $h, "" Edited October 3, 2016 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
AutoBert Posted October 4, 2016 Share Posted October 4, 2016 (edited) 33 minutes ago, BatMan22 said: If I DIDNT want to put in the timeout delay... Could I replace it with JUST WinWaitActive("Reprocess:","")? Without a timeout maybe script waiting since next power interrupt. But if you think 10 sec are to short use a longer timeout value. Edited October 4, 2016 by AutoBert 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