Webs Posted January 5, 2010 Posted January 5, 2010 (edited) I tried searching but couldn't find much help for this... Basically what I'm trying to do is loop through the 11 Windows I have open on my system by title. Just getting this small part functioning is important as it will be part of a larger script. I'm just going crazy trying to figure out what I'm doing wrong. Am I using one of the functions wrong? Or what am I missing? Any help would be greatly appreciatly! While 1 $WindowTitle = WinGetTitle( "" , "" ) Select Case $WindowTitle = ( "File Download" ) MsgBox ( 1, "Window Title - Found it", $WindowTitle) Exit Case Else MsgBox ( 1, "Window Title - Not it", $WindowTitle) EndSelect WEnd MsgBox ( 1, "Out of Loop", "Oh noes") Exit Edited January 5, 2010 by Webs
James Posted January 5, 2010 Posted January 5, 2010 Voilá, Dim $arTitles = WinList() For $i = 1 to $arTitles[0][0] If $arTitles[$i][0] = "File Download" Then MsgBox ( 1, "Window Title - Found it", $arTitles[$i][0]) Exit Else ConsoleWrite("!> " & $arTitles[$i][0] & " is not it :(" & @CRLF) EndIf Next MsgBox (1, "Out of Loop", "Oh noes") Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
Webs Posted January 5, 2010 Author Posted January 5, 2010 Thanks for the help James, your code worked perfectly! If I understand things correctly, my code needs an array that has all the titles in it, otherwise the msgbox will only display one title which will be the first one it comes across.
James Posted January 5, 2010 Posted January 5, 2010 Thanks for the help James, your code worked perfectly! If I understand things correctly, my code needs an array that has all the titles in it, otherwise the msgbox will only display one title which will be the first one it comes across.WinList puts all of the window titles (as of calling) into a two dimensional array. And the way the code I showed you, will also just display one message box because of the Exit command beneath it Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
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