Schwoby Posted September 9, 2020 Share Posted September 9, 2020 i am attempting to activate two different 'Google Chrome' windows. one is a specific window title that never changes and maintains the focus during/between script runs. the other window title will change on a regular basis. if i do something like this: Opt("WinTitleMatchMode", 2) WinActivate("Google Chrome") WinActivate("<Static Name> - Google Chrome") when i click on the non-static window first, then run the script, it works as desired. if the static window is active most recently (of the chrome windows), then the script activates the static window twice. does anyone know of a way to properly script a sudo statement like: WinActivate("Google Chrome") Where NOT WinActive("<Static Name> - Google Chrome") Link to comment Share on other sites More sharing options...
Danp2 Posted September 9, 2020 Share Posted September 9, 2020 You could do something like this -- Local $aList = WinList("Google Chrome") ; Loop through the array displaying only visable windows with a title. For $i = 1 To $aList[0][0] If StringInStr($aList[$i][0], "<Static Name>") = 0 Then WinActivate($aList[$i][1]) ExitLoop EndIf Next Schwoby 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Schwoby Posted September 9, 2020 Author Share Posted September 9, 2020 that worked perfectly! thank you so much. i'm still learning nested value loops, so you helped with multiple thing for me in your one answer! 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