DigDeep Posted March 3, 2014 Posted March 3, 2014 (edited) Hi, I wanted to copy address from browsers opened and paste them to a text file created in C:Temp. With the below code, I am able to check only the 1st instance of the browser opened. If other browsers are also opened it doesn't detect them. Can someone help me fix teh below code please? Local $sFilePath = "C:\Temp\Browser.txt" _FileCreate ($sFilePath) $browserlistdatamax= 2 $browserlistmax= 3 $link= "no browser found"; this Link is missing Zelda dim $browserlist[$browserlistmax][$browserlistdatamax] $browserlist[0][0]= "[CLASS:MozillaWindowClass]"; use 'autoit window info' tool to aquire these values from each browser $browserlist[1][0]= "[CLASS:IEFrame]" $browserlist[2][0]= "[CLASS:Chrome_WidgetWin_0]" $browserlist[2][1]= 1; click window to focus for $i= 0 to $browserlistmax+1; loop through browser list. catch the first browser we find, let all the other ones go if WinExists($browserlist[$i][0])= 1 then; check if each browser is running winactivate($browserlist[$i][0]) ;WinSetState($browserlist[$i][0], "", @SW_SHOWNORMAL) WinWaitActive($browserlist[$i][0]) if $browserlist[$i][1]= 1 Then; click to focus $winpo= WinGetPos($browserlist[$i][0]) mouseclick("left", $winpo[0]+10, $winpo[1]+10, 1, 0) endif; end if click to target window sleep(50) Send("{F6}") sleep(200) send ("^c") $link= ClipGet() exitloop endif; end id winexists($browserlist[$i][0]) next; end for $browserlistmax-1 MsgBox(0, "browser address:", $link) exit func out($output= "");debug tool ConsoleWrite(@CRLF&$output);to console: new line, value of $output EndFunc; end out() Edited March 3, 2014 by sunshinesmile84
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