PeteP Posted March 31, 2008 Share Posted March 31, 2008 Hello, How can I activate a window which contain certain text in title, but doesn't contain some other known text... For example if title contain abc but doesn't contain dfg?? Thanks -Pete Link to comment Share on other sites More sharing options...
Developers Jos Posted March 31, 2008 Developers Share Posted March 31, 2008 (edited) when there is a chance on multiple windows containing "abc" you could retrieve all titles With WinList() and do your own testing on the available windows and activating the one you need. Something like : $var = WinList() ; For $i = 1 to $var[0][0] If StringInStr($var[$i][0],"Abc") And Not StringInStr($var[$i][0],"dfg") Then WinActivate($var[$i][1],"") EndIf Next Edited March 31, 2008 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Paulie Posted March 31, 2008 Share Posted March 31, 2008 (edited) $array = Winlist() For $x = 1 to $array[0][0] If StringInStr($array[$x][0], "abc") And NOT StringInStr($array[$x][0], "dfg") then WinActivate($array[$x][1]) Exitloop ;optional, if you want it to exit after first window is found and activated EndIf Next EDIT: Wow Jos. Are you reading my mind? Edited March 31, 2008 by Paulie Link to comment Share on other sites More sharing options...
PeteP Posted March 31, 2008 Author Share Posted March 31, 2008 (edited) Thanks a lot guys!!!!!!!! -Pete Edited March 31, 2008 by PeteP Link to comment Share on other sites More sharing options...
Paulie Posted March 31, 2008 Share Posted March 31, 2008 (edited) Thanks a lot guys!!!!!!!!-Peelmao you missed a letter me thinks :) Edit: sorry, i couldn't help it. What can I say? I'm immature. Edited March 31, 2008 by Paulie 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