___Kevin___ Posted April 8, 2006 Share Posted April 8, 2006 Hi,i'm trying to write a script that waits for windows to come up and handles them.At the moment, this is my code:Opt("WinTitleMatchMode", 2) ;wait for a window containing "Untitled" WinWaitActive("Untitled") $title = WinGetTitle("Untitled") ... do something...This only works with one window. I need to handle multiple windows which contain my searchstring in their titles, so something returning a list of titles matching my search would be perfect. Any ideas?Thanks,Kevin. Link to comment Share on other sites More sharing options...
AutoChris Posted April 8, 2006 Share Posted April 8, 2006 WinList()'Nuff said Link to comment Share on other sites More sharing options...
___Kevin___ Posted April 8, 2006 Author Share Posted April 8, 2006 (edited) Oops... Thanks. Edited April 8, 2006 by ___Kevin___ Link to comment Share on other sites More sharing options...
Uten Posted April 9, 2006 Share Posted April 9, 2006 This is the nicest solution to this if you ask me. Have not tried it yet thought. The Latest AutoIt Beta can wait for more then 2 windows by using regular expressions. Here is a Demo Opt('WinTitleMatchMode', 4) Switch Random(1, 3, 1) Case 1 RunWait('explorer "' & @ProgramFilesDir & '"') Case 2 RunWait('explorer "' & @WindowsDir & '"') Case 3 RunWait('explorer "' & @SystemDir & '"') EndSwitch WinWait('regexp=(?i)program files|windows|system32', '', 1) $title = WinGetTitle('regexp=(?i)program files|windows|system32') Sleep(500) WinClose($title) Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling 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