rot Posted October 7, 2010 Posted October 7, 2010 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
wakillon Posted October 7, 2010 Posted October 7, 2010 For IE, see IEPropertyGet in helpfile ! 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.0 - WIN 11 24H2 X64 - Other Examples Scripts
rot Posted October 7, 2010 Author Posted October 7, 2010 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
wakillon Posted October 7, 2010 Posted October 7, 2010 (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 ! ; ******************************************************* ; 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 October 7, 2010 by wakillon AutoIt 3.3.18.0 X86 - SciTE 4.4.6.0 - WIN 11 24H2 X64 - Other Examples Scripts
rot Posted October 7, 2010 Author Posted October 7, 2010 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?
wakillon Posted October 7, 2010 Posted October 7, 2010 thanks a lot wakillonthis 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 ! AutoIt 3.3.18.0 X86 - SciTE 4.4.6.0 - WIN 11 24H2 X64 - Other Examples Scripts
rot Posted October 7, 2010 Author Posted October 7, 2010 Sorry it's not the 6, but the 5 th example ! No problem, I've been working on other issues this afternoon ...
wakillon Posted October 7, 2010 Posted October 7, 2010 No problem, I've been working on other issues this afternoon ... which issues ? AutoIt 3.3.18.0 X86 - SciTE 4.4.6.0 - WIN 11 24H2 X64 - Other Examples Scripts
rot Posted October 8, 2010 Author Posted October 8, 2010 which issues ? nothing to do with autoit ...
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