Sign in to follow this  
Followers 0
DigDeep

Copy Browser address to text

2 posts in this topic

#1 ·  Posted (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 by sunshinesmile84

Share this post


Link to post
Share on other sites

Use WinList.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0