Jump to content

IE events


Juvigy
 Share

Recommended Posts

Link to comment
Share on other sites

attach("http://www.dir.bg/")
$test=ObjEvent($oIE,"IEEvent_","DWebBrowserEvents")
$test2=ObjEvent($oIE,"IEEvent_","DWebBrowserEvents2")
While 1
 Sleep(10)
WEnd

Func IEEvent_($event)
MsgBox( 0,"","")
EndFunc

This code should pop up a msg box every time an IE event is fired. I dont get any popup when i do actions on the webpage.

@EDIT Attach is a custom function using IEATTACH - that part works , i tested it.

Edited by Juvigy
ADD
Link to comment
Share on other sites

You must define the event to be handled. 

 

#include <MsgBoxConstants.au3>
#include <IE.au3>


Local $oIE = _IECreate("", 0, 1, 0)
; Custom sink object
Local $oIEEvents = ObjEvent($oIE, "_IEEvent_", "DWebBrowserEvents2")

_IENavigate($oIE, "www.autoitscript.com")
While True
    Sleep(30)
WEnd


; BeforeNavigate2 method definition
Func _IEEvent_BeforeNavigate2($oIEpDisp, $sIEURL, $iIEFlags, $sIETargetFrameName, $sIEPostData, $iIEHeaders, $bIECancel)
    MsgBox(0, "", "Event")
EndFunc   ;==>_IEEvent_BeforeNavigate2

Saludos

Link to comment
Share on other sites

  • 8 months later...

This is from the help file :

Quote

If you don't know (for some reason) the names of the events, you can add a UDF with only the prefix. In this example: Func IEEvent_($Eventname).
When an event is received and no IEEvent_ Eventname UDF exists, this function will be called instead and the name of the event will be placed in the variable $Eventname.

Can someone please test it and advise if my error reproducer works ?

$test=ObjEvent($oIE,"IEEvent_","DWebBrowserEvents")
$test2=ObjEvent($oIE,"IEEvent_","DWebBrowserEvents2")

Func IEEvent_($event)
    msgbox(0,"","")
End Func

Each event will popup a msg so you should see many msgs. I dont have any msg popups when testing this code!

Link to comment
Share on other sites

10 hours ago, Chimp said:

where did you found those infos?

Maybe in
Obj/COM Reference

in AutoIt HelpFile

Quote

Click here to view the complete script.

There is similar example:

Func IEEvent_($sEventName)
    ; This is an optional event function to catch non-defined events.
    ; The parameter contains the name of the event being called.
    GUICtrlSetData($g_idGUIEdit, "Uncatched event: " & $sEventName & @CRLF, "append")
EndFunc   ;==>IEEvent_

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

I removed that from AutoIt few years back. The feature was consuming too many resources and have been slowing down execution.
On top of that, the feature is senseless. You either know what you want to capture, or don't capture at all. Third option is just gay.

Unfortunately I missed the example script from the help file.

Edited by trancexx

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Good to know.
So help file should be revised in this regard.

Thanks @trancexx for explanation.

mLipok

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

while experimenting with Obj events, I slammed into a wall...
I'm stucked on how to correctly refer the 'event' object within the event function in the AutoIt listing.
the commented line 79, should print coordinates of the mouse while mouse is moving on the web page, I get an error instead.
event.clientX and event.clientY should return the mouse coordinates,
see here ?? : https://msdn.microsoft.com/en-us/library/ms536947(v=vs.85).aspx
and/or here: ?? https://msdn.microsoft.com/en-us/library/ff975920(v=vs.85).aspx

what I'm doing wrong?

; We use a very simple GUI to show the results of our Events.

#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
Global $g_idGUIEdit

Example()
Exit ; End of our Demo.

Func Example()
    Local $hGUIMain = GUICreate("Event Test", 1000, 600)
    $g_idGUIEdit = GUICtrlCreateEdit("", 5, 405, 990, 175)
    ; GUICtrlSetBkColor(-1, 0x000000)
    ; GUICtrlSetColor(-1, 0x00FF00)
    GUICtrlSetFont(-1,12, 400, -1, 'Courier New')
    GUICtrlCreateLabel("Below are some Browser events 'captured' from the above web page by AutoIt", 5, 385,990, 20)
    Local $idGUIExit = GUICtrlCreateButton(" Close and exit", 5, 580, 990, 15)
    GUISetState() ;Show GUI

    ; We prepare the Internet Explorer as our test subject
    Global $oIE = ObjCreate("Shell.Explorer.2")
    $hIE = GUICtrlCreateObj($oIE, 5, 5, 990, 380) ; <- insert $oIE in the AutoIt GUI

    ; Here we load an example Web page just to have something viewed in the browser
    $oIE.navigate('http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/onmousemoveEX.htm')
    Sleep(1000) ; Give it some time to load the web page

    Do ; wait for document
        Sleep(250)
        $oDocument = $oIE.document
    Until IsObj($oDocument)

    ;   +  Scripting Object Interfaces
    ;   |  ---------------------------
    ;   |  https://msdn.microsoft.com/en-us/library/hh801967(v=vs.85).aspx
    ;   |
    ;   +-->   HTMLDocumentEvents2 interface (catch OnClick, OnMouseOver, .... etc
    ;          -----------------------------
    ;          https://msdn.microsoft.com/en-us/library/aa769764(v=vs.85).aspx
    ;
    Global $oEventObject = ObjEvent($oDocument, "IEEvent2_", "HTMLDocumentEvents2")

    If @error Then
        MsgBox($MB_OK, "AutoIt COM Test", _
                "ObjEvent: Can't use event interface 'HTMLDocumentEvents2'. Error code: " & Hex(@error, 8))
        Exit
    EndIf

    ; GUISwitch($hGUIMain) ; Switch back to our GUI in case IE stole the focus

    ; Waiting for user to close the GUI.
    Local $iMsg
    While 1
        $iMsg = GUIGetMsg()
        If $iMsg = $GUI_EVENT_CLOSE Or $iMsg = $idGUIExit Then ExitLoop
    WEnd

    $oEventObject.Stop ; Tell IE we don't want to receive events.
    $oEventObject = 0 ; Kill the Event Object
    $oIE = 0 ; Remove IE from memory (not really necessary).

    GUIDelete() ; Remove GUI
EndFunc   ;==>Example

; A few Internet Explorer Event Functions
Func IEEvent2_onClick()
    ConsolePrint("mouse click:")
EndFunc   ;==>IEEvent2_onClick

Func IEEvent2_onDblClick()
    ConsolePrint("mouse DoubleClick:")
EndFunc   ;==>IEEvent2_onDoubleClick

Func IEEvent2_onMouseMove($oEvent)
    ; according to what is written here:
    ; https://msdn.microsoft.com/en-us/library/ms536947(v=vs.85).aspx
    ; I should be able to get properties from the event using the 'event.property' syntax
    ; but how to refer to the 'event' obj <---- ???????
    ; ConsolePrint("mouse moved to:" & @TAB & "Xpos = " & $oEvent.clientX & @TAB & "Ypos = " & $oEvent.clientY ) ; <-- error
    ConsolePrint("mouse moved to: ???" & @TAB & "Xpos = " & "event.clientX" & @TAB & "Ypos = " & "event.clientY")
EndFunc   ;==>IEEvent2_onMouseMove

Func ConsolePrint($sMsg)
    Local Const $iMaxLines = 12 ; keep last 12 lines only
    $sMsg = @HOUR & ':' & @MIN & ':' & @SEC & ':' & @MSEC & @TAB & $sMsg & @CRLF
    $sMsg = StringReplace(GUICtrlRead($g_idGUIEdit) & $sMsg, @CR, @CR)
    If @extended > $iMaxLines Then ; more than $iMaxLines
        $sMsg = StringMid($sMsg, StringInStr($sMsg, @CR, 0, -1 * $iMaxLines) + 2)
    EndIf
    GUICtrlSetData($g_idGUIEdit, $sMsg)
EndFunc   ;==>ConsolePrint

any help will be appreciated.
Thanks

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

Link to comment
Share on other sites

Thanks reverend @Danyfirex
I see, declaring event functions as Volatile those works :).

; We use a very simple GUI to show the results of our Events.

#include <GUIConstantsEx.au3>
#include <MsgBoxConstants.au3>
Global $g_idGUIEdit

Example()
Exit ; End of our Demo.

Func Example()
    Local $hGUIMain = GUICreate("Event Test", 1000, 600)
    $g_idGUIEdit = GUICtrlCreateEdit("", 5, 405, 990, 175)
    ; GUICtrlSetBkColor(-1, 0x000000)
    ; GUICtrlSetColor(-1, 0x00FF00)
    GUICtrlSetFont(-1, 9, 400, -1, 'Courier New')
    GUICtrlCreateLabel("Below are some Browser events 'captured' from the above web page by AutoIt", 5, 385, 990, 20)
    Local $idGUIExit = GUICtrlCreateButton(" Close and exit", 5, 580, 990, 15)
    GUISetState() ;Show GUI

    ; We prepare the Internet Explorer as our test subject
    Global $oIE = ObjCreate("Shell.Explorer.2")
    $hIE = GUICtrlCreateObj($oIE, 5, 5, 990, 380) ; <- insert $oIE in the AutoIt GUI

    ; Here we load an example Web page just to have something viewed in the browser
    $oIE.navigate('http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/onmousemoveEX.htm')
    Sleep(1000) ; Give it some time to load the web page

    Do ; wait for document
        Sleep(250)
        $oDocument = $oIE.document
    Until IsObj($oDocument)

    ;   +  Scripting Object Interfaces
    ;   |  ---------------------------
    ;   |  https://msdn.microsoft.com/en-us/library/hh801967(v=vs.85).aspx
    ;   |
    ;   +-->   HTMLDocumentEvents2 interface (catch OnClick, OnMouseOver, .... etc
    ;          -----------------------------
    ;          https://msdn.microsoft.com/en-us/library/aa769764(v=vs.85).aspx
    ;
    Global $oEventObject = ObjEvent($oDocument, "IEEvent2_", "HTMLDocumentEvents2")

    If @error Then
        MsgBox($MB_OK, "AutoIt COM Test", _
                "ObjEvent: Can't use event interface 'HTMLDocumentEvents2'. Error code: " & Hex(@error, 8))
        Exit
    EndIf

    ; GUISwitch($hGUIMain) ; Switch back to our GUI in case IE stole the focus

    ; Waiting for user to close the GUI.
    Local $iMsg
    While 1
        $iMsg = GUIGetMsg()
        If $iMsg = $GUI_EVENT_CLOSE Or $iMsg = $idGUIExit Then ExitLoop
    WEnd

    $oEventObject.Stop ; Tell IE we don't want to receive events.
    $oEventObject = 0 ; Kill the Event Object
    $oIE = 0 ; Remove IE from memory (not really necessary).

    GUIDelete() ; Remove GUI
EndFunc   ;==>Example

; A few Internet Explorer Event Functions
; ( reference to the Event Obj interface: )
; ( https://msdn.microsoft.com/en-us/library/aa703876(v=vs.85).aspx )
;
Volatile Func IEEvent2_onClick($oEvent)
    ConsolePrint("mouse click: " & $oEvent.clientX & ',' & $oEvent.clientY & '  on ' & $oEvent.srcElement.NodeName)
EndFunc   ;==>IEEvent2_onClick

Volatile Func IEEvent2_onDblClick($oEvent)
    ConsolePrint("mouse DoubleClick: @" & $oEvent.clientX & ',' & $oEvent.clientY)
EndFunc   ;==>IEEvent2_onDblClick

Volatile Func IEEvent2_onMouseMove($oEvent)
    ConsolePrint("mouse moved to:" & @TAB & "Xpos = " & $oEvent.clientX & @TAB & "Ypos = " & $oEvent.clientY)
EndFunc   ;==>IEEvent2_onMouseMove

Func ConsolePrint($sMsg)
    Local Const $iMaxLines = 9 ; keep last 9 log lines only
    $sMsg = @HOUR & ':' & @MIN & ':' & @SEC & ':' & @MSEC & @TAB & $sMsg & @CRLF
    $sMsg = StringReplace(GUICtrlRead($g_idGUIEdit) & $sMsg, @CR, @CR)
    If @extended > $iMaxLines Then ; more than $iMaxLines
        $sMsg = StringMid($sMsg, StringInStr($sMsg, @CR, 0, -1 * $iMaxLines) + 2)
    EndIf
    GUICtrlSetData($g_idGUIEdit, $sMsg)
EndFunc   ;==>ConsolePrint


p.s.
:huh2: volatile? :think:... yes volatile, naturally! ... :blink:

Edited by Chimp
added link for Event Obj interface

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Link to comment
Share on other sites

20 hours ago, Chimp said:

:huh2: volatile? :think:... yes volatile, naturally! ... :blink:

Just exactly what I said here:

;)

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

On 10/28/2016 at 2:57 PM, trancexx said:

I removed that from AutoIt few years back. The feature was consuming too many resources and have been slowing down execution.
On top of that, the feature is senseless. You either know what you want to capture, or don't capture at all. Third option is just gay.

Unfortunately I missed the example script from the help file.

I was using this functionality for testing purposes. It was very convenient. That way i was looking on the events that were firing at the time i was clicking on a IE page and later on i was refining the code. How do you propose to do that now?

@PS

What does Volatile means? I cant use it - my AutoIT(v3.3.8.1) gives me compilation error "ERROR: syntax error".

Edited by Juvigy
PS
Link to comment
Share on other sites

  • 1 year later...

Howdy,

  First of all...thank you so much for that script @Chimp (and @Danyfirex)...!!!   I just stumbled upon it and it is amazing...it will help me a great deal...

  I have already slightly modified it by adding the ability to display/read the .innertext of a 'clicked' element...now I just wonder is there a way to 'select' the text of an element that has been clicked (for example a <p> or <li> or <td> or whatever)....?  Just a basic 'highlight' selection of the clicked element would be cool.

  It would also be helpful to me to be able to click/drag the element text on the webpage...and read/save that particular .innertext that was highlighted by the user.  For example if the .innertext of a <p> element is "This is some text" and the user clicks/drags on the "This is some" I would like to be able to 'break' that out from the tag...possible...?

  I thought I saw some mention of something similar to that in MS documentation...but I cannot remember where it is or if that would accomplish this...any ideas/suggestions welcome.  Once again thanks for that great code example... !

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

×
×
  • Create New...