Jump to content

Recommended Posts

Posted

Hi all,

I hope you will be able to help me.

I want to trap a particular object click in Firefox that will fire a short script.

I was firstly wondering if I can use the _IE... collection for use in Firefox.

Then I wanted to know if a function exists that can trap object clicks other than _ispressed.

If only the function _ispressed can be used, I will need to compare the coordinates of the mouse when clicking with the ones of the object.

But how can I find the coordinates of an object?

Many thanks for your answer.

rv

Posted

For IE, see IEPropertyGet in helpfile ! Posted Image

example :

$iBrowserX = _IEPropertyGet($oElement, "browserx")
    $iBrowserY = _IEPropertyGet($oElement, "browsery")
    $iWidth = _IEPropertyGet($oElement, "width")
    $iHeight = _IEPropertyGet($oElement, "height")
    ControlClick(_IEPropertyGet($IE, "hwnd"), "", "", "left", 1, $iBrowserX + $iWidth/2, $iBrowserY + $iHeight/2)

AutoIt 3.3.18.0 X86 - SciTE 4.4.6.0WIN 11 24H2 X64 - Other Examples Scripts

Posted

thanks for your answer wakillon ...

I was already looking at the IEPropertyGet function but got lost in the different properties to use to trace the outline. your answer helps a lot.

any idea if an event driven function exists saying the object has been clicked?

thx

Posted (edited)

thanks for your answer wakillon ...

I was already looking at the IEPropertyGet function but got lost in the different properties to use to trace the outline. your answer helps a lot.

any idea if an event driven function exists saying the object has been clicked?

thx

See helpfile for _IEHeadInsertEventScript function ! Posted Image

; *******************************************************
; Example 1 - Open a browser with the basic example page, insert an
;               event script into the head of the document that creates
;               a Javascript alert when someone clicks on the document
; *******************************************************
;
#include <IE.au3>
$oIE = _IE_Example ("basic")
_IEHeadInsertEventScript ($oIE, "document", "onclick", "alert('Someone clicked the document!');")

Edit : the 6th example is more interesting

Edited by wakillon

AutoIt 3.3.18.0 X86 - SciTE 4.4.6.0WIN 11 24H2 X64 - Other Examples Scripts

Posted

thanks a lot wakillon

this function looks more interesting ... unfortunatly I don't have the 6th sample on my version of autoit, but don't worry I'll find it and come back to you if I succeed ... or if I have another question ... who knows? ;)

:)

Posted

thanks a lot wakillon

this function looks more interesting ... unfortunatly I don't have the 6th sample on my version of autoit, but don't worry I'll find it and come back to you if I succeed ... or if I have another question ... who knows? ;)

:)

Sorry it's not the 6, but the 5 th example ! Posted Image

AutoIt 3.3.18.0 X86 - SciTE 4.4.6.0WIN 11 24H2 X64 - Other Examples Scripts

Posted

Sorry it's not the 6, but the 5 th example ! Posted Image

No problem, I've been working on other issues this afternoon ...

;)

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
×
×
  • Create New...