Jump to content

FileWrite lines Match


 Share

Recommended Posts

Hi i getting cofoused here

i want to do somthing like when url match then write log in same lines else if not match then write on other line how can i achive this ?

like

$surl  = _IEPropertyGet ($oIE, "locationurl")
if $surl = $surl
$file = FileOpen("mylog.txt",1)
FileWrite($file, $surl)
else


Endif
Edited by autoitxp
Link to comment
Share on other sites

k here is ma code in this code it save URLS of current active window how i can i save same link at same line

#include <GUIConstants.au3>
#include <Misc.au3>
#include <IE.au3>
#include <file.au3>

GUICreate("_IE")  
GUISetState (@SW_SHOW)   
$dll = DllOpen("user32.dll")


While 1
    $msg = GUIGetMsg()
    Select
        
        
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
        
    Case  _IsPressed("01", $dll) 
        _IE()
        
    Case  _IsPressed("0D", $dll) 
        _IE()
EndSelect
Wend
    
    
Func _IE()
$sHwnd = WinGetHandle("")
$window = WinGetTitle($sHwnd)
$len =  StringTrimRight($window, 30)
$oIE = _IEAttach($len)
$surl  = _IEPropertyGet ($oIE, "locationurl")
$file = FileOpen("mylog.txt",1)
FileWrite($file, $surl & @CRLF)
FileClose($file)
    EndFunc
    DllClose($dll)
Edited by autoitxp
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...