Kasteel Posted October 13, 2009 Share Posted October 13, 2009 Hi I am using WinWaitActive to wait for a screen to come up before I continue. The problem is that the screen header will sometimes say "Test1" and other times it would say "Test2". Is it possible to specify 2 dailog text strings for it to wait for? Example: WinWaitActive("Test1") OR WinWaitActive("Test2") Any help would be appreciated. Thanks Link to comment Share on other sites More sharing options...
jebus495 Posted October 13, 2009 Share Posted October 13, 2009 (edited) HiI am using WinWaitActive to wait for a screen to come up before I continue. The problem is that the screen header will sometimes say "Test1" and other times it would say "Test2". Is it possible to specify 2 dailog text strings for it to wait for?Example: WinWaitActive("Test1") OR WinWaitActive("Test2") Any help would be appreciated.ThanksWinWaitActive("Test")???See "Window Titles and Text (Advanced)" in the help file for more information. Edited October 13, 2009 by jebus495 Link to comment Share on other sites More sharing options...
Kasteel Posted October 13, 2009 Author Share Posted October 13, 2009 WinWaitActive("Test")???See "Window Titles and Text (Advanced)" in the help file for more information.I tried that but had no luck. Link to comment Share on other sites More sharing options...
jebus495 Posted October 13, 2009 Share Posted October 13, 2009 (edited) I tried that but had no luck. Try Opt("WinTitleMatchMode", 2) And if even that fails... NVM Didn't work lol... Edit: Do $test1 = WinWaitActive("Test1", "", 1) $test2 = WinWaitActive("Test2", "", 1) Until $test1 Or $test2 = 1 If that doesn't work then IDK what to tell you. Edited October 13, 2009 by jebus495 Link to comment Share on other sites More sharing options...
Kasteel Posted October 14, 2009 Author Share Posted October 14, 2009 Try Opt("WinTitleMatchMode", 2) And if even that fails... Thanks NVM Didn't work lol... Edit: Do $test1 = WinWaitActive("Test1", "", 1) $test2 = WinWaitActive("Test2", "", 1) Until $test1 Or $test2 = 1 If that doesn't work then IDK what to tell you. Link to comment Share on other sites More sharing options...
omikron48 Posted October 14, 2009 Share Posted October 14, 2009 (edited) Opt("WinTitleMatchMode", 2) That will let you succeed on a partial match with any title text. In your case, in conjunction with that Opt, you would use this towait for any of your two windows: WinWaitActive("Test") That works since "Test" has a partial match to both "Test1" and "Test2". Actually, now that I think of it, you don't even need use the Opt since window title matching is done from left to right by default to "Test" will match both "Test1" and "Test2". You only need to set that Opt if your partial string is located somewhere else in your title text. If, however, you want to wait for more than one window and their title texts differ greatly, then you have to code it manually. While NOT WinActive($title1) OR NOT WinActive($title2) Sleep(100) WEnd Edited October 14, 2009 by omikron48 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