Jump to content

_ietagnamegetcollection


Recommended Posts

DOM

<TD style="PADDING-LEFT: 20px; PADDING-BOTTOM: 2px" id=zoomin_button><UL id=buttonh>

<LI class=zoomin><A onmouseup="return stopZoomIn();" class=zoomin onmouseover="window.status='zoom in'; return true;" onmouseout="window.status=''; stopThreads()" onmousedown="return startZoomIn();" onclick="return false" href="">&nbsp;</A></LI></UL></TD>

Function been called

function startZoomIn() {

document.alinkColor="#009999";

zooming = true;

if (FirstZoom == false) doFirstZoom (true);

setTimeout("zoomInThread()", 250);

return false;

}

$oElements = _IETagNameGetCollection ($oIE, "A")

For $oElement In $oElements

If String($oElement.class) = "zoomin" Then

ConsoleWrite("I found it - it is $oElement" & @CR)

MouseDown("left")

MouseUp("left")

EndIf

Next

error:

C:\Program Files\AutoIt3\Examples\Helpfile\iqtest.au3 (25) : ==> The requested action with this object has failed.:

If String($oElement.class) = "zoomin" Then

If String($oElement.class^ ERROR

Link to comment
Share on other sites

error:

C:\Program Files\AutoIt3\Examples\Helpfile\iqtest.au3 (25) : ==> The requested action with this object has failed.:

If String($oElement.class) = "zoomin" Then

If String($oElement.class^ ERROR

Try $oElement.classname vice .class.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

$ozis = _IETagnameGetCollection($oIE, "A")

For $ozi in $ozis

If String($ozi.className) = "zoomin" Then

_IEAction($ozi, "focus")

$iScreenX = _IEPropertyGet($ozi, "screenx")

$iScreenY = _IEPropertyGet($ozi, "screeny")

$iBrowserX = _IEPropertyGet($ozi, "browserx")

$iBrowserY = _IEPropertyGet($ozi, "browserY")

$iWidth = _IEPropertyGet($ozi, "width")

$iHeight = _IEPropertyGet($ozi, "height")

MouseMove($iScreenX + $iWidth, $iScreenY)

MouseMove($iScreenX + $iWidth, $iScreenY + $iHeight)

MouseMove($iScreenX, $iScreenY + $iHeight)

MouseMove($iScreenX, $iScreenY)

MouseMove($iScreenX + $iWidth/2, $iScreenY + $iHeight/2)

Sleep(500)

MouseClick("left")

Sleep(500)

MouseDown("left")

MouseUp("left")

EndIf

Next

How do you click on the buttong, the iepropertyget --> positions the mouse in reference to the browser but not the object or element??

Edited by diikee
Link to comment
Share on other sites

$ozis = _IETagnameGetCollection($oIE, "A")

For $ozi in $ozis

If String($ozi.className) = "zoomin" Then

_IEAction($ozi, "focus")

$iScreenX = _IEPropertyGet($ozi, "screenx")

$iScreenY = _IEPropertyGet($ozi, "screeny")

$iBrowserX = _IEPropertyGet($ozi, "browserx")

$iBrowserY = _IEPropertyGet($ozi, "browserY")

$iWidth = _IEPropertyGet($ozi, "width")

$iHeight = _IEPropertyGet($ozi, "height")

MouseMove($iScreenX + $iWidth, $iScreenY)

MouseMove($iScreenX + $iWidth, $iScreenY + $iHeight)

MouseMove($iScreenX, $iScreenY + $iHeight)

MouseMove($iScreenX, $iScreenY)

MouseMove($iScreenX + $iWidth/2, $iScreenY + $iHeight/2)

Sleep(500)

MouseClick("left")

Sleep(500)

MouseDown("left")

MouseUp("left")

EndIf

Next

How do you click on the buttong, the iepropertyget --> positions the mouse in reference to the browser but not the object or element??

Is there an Opt("MouseCoordMode", $n) in your script? It works best with a mode of 1 (the default) and using the Screen coordinates. The Browser coordinates come up wrong no matter which mode I use.

Did you try just using _IEAction($ozi, "click")?

:)

Update: I figured out how to correct the "BrowserX" and "BrowserY" coordinates:

Opt("MouseCoordMode", 2)
$hIE = _IEPropertyGet($oIE, "hwnd")
$avOffset = ControlGetPos($hIE, "", "[CLASS:Internet Explorer_Server;INSTANCE:1]")
$iBrowserX = _IEPropertyGet($oTextArea, "browserx") + $avOffset[0]
$iBrowserY = _IEPropertyGet($oTextArea, "browserY") + $avOffset[1]

The "Client Area" mode 2 doesn't quite match because it includes the various toolbars at the top of the IE window. The "BrowserX/Y" coordinates are relative to the Explorer_Server instance, so you need to add the offset.

:)

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Tried

_ieaction($ozi, "focus") ----->I can see it focus

sleep(500)

_ieaction($ozi, "click") ------->but it doesn't get clicked

is it possible to call the startzoom() directly??

I don't know how (that doesn't mean it can't be done). The screen coordinates with MouseCoordMode = 1 should have worked for you. If you needed to use the browser coordinates, see the Update to my last post.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Updated version of the demo from _IEPropertyGet() to show both coordinate methods used:

#include <IE.au3>

; *******************************************************
; Example 2 - Open a browser with the form example and get a reference to the form
;              textarea element.  Get the coordinates and dimensions of the text area,
;              outline its shape with the mouse and come to rest in the center.  Do
;              this twice, with both screen and browser coordinates.
; *******************************************************
;
$oIE = _IE_Example("form")

$oForm = _IEFormGetObjByName($oIE, "ExampleForm")
$oTextArea = _IEFormElementGetObjByName($oForm, "textareaExample")

; Get coordinates and dimensions of the textarea
$iScreenX = _IEPropertyGet($oTextArea, "screenx")
$iScreenY = _IEPropertyGet($oTextArea, "screeny")
$iWidth = _IEPropertyGet($oTextArea, "width")
$iHeight = _IEPropertyGet($oTextArea, "height")

; Using screen coordinates: Outline the textarea with the mouse, come to rest in the center
Opt("MouseCoordMode", 1); Screen mode
MouseMove($iScreenX, $iScreenY)
MouseMove($iScreenX + $iWidth, $iScreenY)
MouseMove($iScreenX + $iWidth, $iScreenY + $iHeight)
MouseMove($iScreenX, $iScreenY + $iHeight)
MouseMove($iScreenX, $iScreenY)
MouseMove($iScreenX + $iWidth / 2, $iScreenY + $iHeight / 2)
Sleep(1000)

; Do it again, using browser coordinates
Opt("MouseCoordMode", 2); Window Client mode
$hIE = _IEPropertyGet($oIE, "hwnd")
$avOffset = ControlGetPos($hIE, "", "[CLASS:Internet Explorer_Server;INSTANCE:1]")
$iBrowserX = _IEPropertyGet($oTextArea, "browserx") + $avOffset[0]
$iBrowserY = _IEPropertyGet($oTextArea, "browserY") + $avOffset[1]
MouseMove($iBrowserX, $iBrowserY)
MouseMove($iBrowserX + $iWidth, $iBrowserY)
MouseMove($iBrowserX + $iWidth, $iBrowserY + $iHeight)
MouseMove($iBrowserX, $iBrowserY + $iHeight)
MouseMove($iBrowserX, $iBrowserY)
MouseMove($iBrowserX + $iWidth / 2, $iBrowserY + $iHeight / 2)

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...