Jump to content

Recommended Posts

Posted

It looks very interesting

I'll be testing your UDF in the new year.

Thanks fo sharing.

Best regards

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:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

OS:WIN_81/  CPU:X64 OS:X64

autoit stabil version and beta version

error  !>23:49:47 AutoIt3.exe ended.rc:-1073741571

--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop
!>23:49:47 AutoIt3.exe ended.rc:-1073741571
+>23:49:47 AutoIt3Wrapper Finished.
>Exit code: 3221225725    Time: 10.07

Eval Example:

ClassName Array Example:

ClassName Collection Example:

querySelector and Click Example:

dont work why?

thank you now.

  • Moderators
Posted (edited)

Hi mesale007,

Unfortunately, I do not have that system setup around to debug that in.  I'm utilizing someone else's pc for the next few weeks with no access to even a vm win8.

Out of curiosity, are you running IE11?

Edit:

I assume you mean current stable and beta versions?

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

  • Moderators
Posted

You'll notice in the the comments from the main funcs (eval/execscript), that I had a concern with IE11, I have had zero chance to debug or use it.

Maybe you can step through the code in spots and see where it fails.  Otherwise, I won't be able to do much for some time.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted (edited)

For some reason this code do not work - i want image context menu to appear

$oIE = _IEAttach (WinGetTitle ( $hWnd_S ), 'Embedded',1)
$oImgs = $oIE.document.images
For $oImg In $oImgs
.....
$PICFrameSize = _IEJS_GetObjPos($oImg)
If $PICFrameSize[1] < 0 Then $PICFrameSize[1] = 0
$PICFrameSize[0] += $IESWindowSize[0] + _WinAPI_GetSystemMetrics(32)
$PICFrameSize[1] += $TBSWindowSize[3]+ $IESWindowSize[1] + _WinAPI_GetSystemMetrics(4)
Local $redyState = $oImg.readyState
ConsoleWrite("$oImg.readyState PRE = "&$redyState&@CRLF)
If $redyState == "uninitialized" Then _IEJS_JSMouseEventObj($oIE, $oImg, "ContextMenu",$PICFrameSize[0],$PICFrameSize[1])
ConsoleWrite("error = "&@error&@CRLF)

there are no error:

$oImg.readyState PRE = uninitialized
error = 0

ie in my case - embedded IE6

Edited by Iczer
  • Moderators
Posted (edited)

Iczer, if I can't replicate it with working reproducer code, I can't help to debug it.  Good luck.

Edit:

FYI, there is no point call for contextmenu btw.  the x & y positions being passed are not relevant.

Edit2:

I think I found the issue in the JS code.  Me getting ahead of myself I believe.

I'll fix that and add contextmenupoint func (not sure it'll work though, you can test when it's up).

I have one or two other things I'm working on fixing at the moment as well before I upload.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

  • Moderators
Posted

Ok Iczer and mesale0077, give your perspective scripts a try.

@Iczer, you'll have to change your:

_IEJS_JSMouseEventObj($oIE, $oImg, "ContextMenu",$PICFrameSize[0],$PICFrameSize[1])

To

_IEJS_JSMouseEventObj($oIE, $oImg, "ContextMenuPoint",$PICFrameSize[0],$PICFrameSize[1])

 

@mesale0077, I'm unsure if the change I made to the app version is going to help you, but it shouldn't hurt.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted

hmm... it still cannot make context menu to appear, but now i get:

$oImg.readyState PRE = uninitialized
error = 7          extended = 3
_IEJS_JSMouseEventObj($oIE, $oImg, "ContextMenuPoint",$PICFrameSize[0],$PICFrameSize[1])
_IEJS_JSMouseEventObj($oIE, $oImg, "ContextMenuPoint")

it seems it cannot find image... but $oImg.scrollIntoView() and _IEJS_GetObjPos($oImg) are working OK

  • Moderators
Posted

@mesale0077, good deal, thank you.

@Iczer, I cannot replicate your situation/issue as you know by now.

#include "IEJS.au3"

; disregard _IEAttach console error if instance doesn't exist yet
Global $goIE = _IECreate("http://www.javascripttoolbox.com/lib/contextmenu/", 1)

_ExampleContextMenu($goIE)
ConsoleWrite(@error & ":" & @extended & @CRLF)

;_IEQuit($goIE)

Func _ExampleContextMenu(ByRef $oObj)

    If Not IsObj($oObj) Then
        Return SetError(1, 0, 0)
    EndIf

    Local $oDivContainer = _IEJS_JSObjQuerySelector($oObj, 'div[class="context-menu ' & _
        'context-menu-theme-vista context-menu-example-trigger menu-vista"]')
    If Not IsObj($oDivContainer) Then
        Return SetError(2, 0, 0)
    EndIf

    Local $oDivOuter = _IEJS_JSGetObjByClassName($oDivContainer, "context-menu-item", "div")
    If @error Then
        Return SetError(3, 0, 0)
    EndIf

    $oDivOuter.scrollIntoPoint()
    
    ; point with no coordinates is defaulted to center
    ;  however, some context events check the mouse position instead of the 
    ;  object position, in order to determine where to put the contextMenu popup
    Local $iRet = _IEJS_JSMouseEventObj($oObj, $oDivOuter, "contextMenuPoint")
    IF @error Then
        Return SetError(@error, @extended, $iRet)
    EndIf

    Return 1
EndFunc

This works as expected because they have an event for onContextMenu.

I'm also putting this in examples.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

  • Moderators
Posted

I've added a couple of new funcs.

_IEJS_TabCreate(); I've seen often people wanting to know how to manage working in tabs, this will come in handy for those people.

_IEJS_MouseEventExec(); This does not use your physical mouse, it doesn't utilize JS, it utilizes postMessage and the WM_M* calls.  I have an example of it working really well (contextMenu even centers) in the Examples folder I just uploaded, it's called: IEJSMouseEventGetPosGetScroll.au3 (should read IEJSMouseEventGetPosGetScrollExample.au3 oops).

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

  • Moderators
Posted

Fixed 2 functions added feature to get embedded IE major version as well.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

  • Moderators
Posted

2014-12-30    B0.0.6    Added:    _IEJS_EmbeddedGetVersion(); Get the embedded version used from something like _IECreateEmbedded

2014-12-30    B0.0.6    Added:    _IEJS_EmbeddedSetVersion(); Set the embedded version used from something like _IECreateEmbedded (see example)

2014-12-30    B0.0.6    Added:    _IEJS_TabAttach(); Similar to _IEAttach(), but browser specific and different string cases

2014-12-30    B0.0.6    Added:    _IEJS_TabCount(); Get a count of the tabs open in a specific browser session

2014-12-30    B0.0.6    Added:    _IEJS_TabGetInstance(); Get the tab instance number from the specific browser session

2014-12-30    B0.0.6    Added:    _IEJS_WinGetBrowserObjArray(); Get all the browser objects (tabs) from a specific browser window handle/title

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

  • 4 weeks later...
Posted (edited)

Hi,

I'm getting this error while using IEJS.au3:

Files (x86)\AutoIt3\Include\IEJS.au3" (555) : ==> Recursion level has been exceeded - AutoIt will quit to prevent stack overflow.:

I'm trying to use it with this call:

Local $hBtn   

$hBtn = _IEJS_JSGetObjByClassName($oIE,"buttonLink100",Default,Default)

Am I using the function correctly.

Thanx in advance for your time.

[Edit]

I'm using version  IEJS.B006.zip

Edited by Scriptonize

If you learn from It, it's not a mistake

  • Moderators
Posted

Hi scriptonize,

There's only one place where it can have a recurse issue.  Thought I may have fixed that issue to be honest when checking for versioning.

I had foreseen a possible issue with people that are using IE11, as execScript was removed by microsoft.  I assume you are also using IE11?

I am also going to be locking this thread soon, I have many more functions to add, but I'm changing this to IEEx.au3 as I will be having many standard, javascript, and possibly jquery functions later on down the line.  So any foresight you can offer I'd appreciate (eg. IE version, IE update version , AutoIt version, and anything else you may deem important to know).

For now, this is a new function that will be added to the IEEx.au3 that uses standard properties, it returns an array, so you'd have to cycle through an array of objects rather than use the object specifically.

Where you'd normally do (pseudo):

$oClass = _class_function_here()
ConsoleWrite($oClass.id & @CRLF)

You'd do:

$aOClass = _arrayclass_function_here()
ConsoleWrite($aOClass[n].id & @CRLF)
;================================================================================================================================
;
; Function Name....:    _IEEx_ClassNameGetArray(ByRef $oObj, $sClass, $sTag = Default, $iIndex = Default)
; Description......:
; Parameter(s).....:
;                       $oObj:   The document/form/browser/window object you're working with
;                       $sClass: The class string you want to find
;                       $sTag:   [Optional: Default = Empty String], the tag name type you want to search in
;                       $iIndex: [Optional: Default = -1 (All Found)]; The index number you want to return
; Return Value(s)..:
;                       Success...: An array of objects found by class name
;                       Failure...: 0
;                       Error.....: 0 = Success, error returns taken from IE.au3
;                                   1 = General Error, 2 = COM Error, 3 = Invalid Data Type
;                                   4 = Invalid Object Type, 5 = Invalid Value
;                                   6 = Load Wait Timeout, 7 = No Match, 8 = Access Denied
;                       Extended..: the number returned is for debugging only, there is data
;                                    returned for both success and failures, it marks the part
;                                    of the code for easier debugging
; Requirement(s)...:
; Author(s)........:    SmOke_N (Ron Nielsen) Ron.SMACKThatApp@gmail.com
; Modified.........:
; Comment(s).......:
; Example(s).......:
;
;================================================================================================================================

Func _IEEx_ClassNameGetArray(ByRef $oObj, $sClass, $sTag = Default, $iIndex = Default)
    ; returns an array of objects

    If Not IsObj($oObj) Then
        Return SetError($_IESTATUS_InvalidDataType, 1, 0)
    EndIf

    $iIndex = (IsKeyword($iIndex) Or $iIndex < 0) ? -1 : $iIndex
    $sTag = (IsKeyword($sTag) Or Not StringLen($sTag)) ? "" : $sTag

    Local $oTags = (StringLen($sTag)) ? _IETagNameGetCollection($oObj, $sTag, $iIndex) : _
        _IETagNameAllGetCollection($oObj, $iIndex)
    Local $iExtended = @extended
    If Not IsObj($oTags) Then
        Return SetError($_IESTATUS_NoMatch, 2, 0)
    EndIf

    Local $aORet[$iExtended], $iCount
    If $iIndex = -1 Then
        For $oTag In $oTags
            If String($oTag.classname) = $sClass Then
                $aORet[$iCount] = $oTag
                $iCount += 1
            EndIf
        Next
    Else
        $aORet[$iCount] = $oTags.index($iIndex)
        If Not IsObj($aORet[$iCount]) Then
            Return SetError($_IESTATUS_InvalidValue, 3, 0)
        EndIf
        $iCount += 1
    EndIf

    If Not $iCount Then
        Return SetError($_IESTATUS_NoMatch, 4, 0)
    EndIf

    ReDim $aORet[$iCount]

    Return SetError($_IESTATUS_Success, 1, $aORet)
EndFunc   ;==>_IEEx_ClassNameGetArray

.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted

Hi Smoke_N

Thank you for replying.

You are right, I'm using IE11 (11.0.9600.17501)

The update version number of IE is: 11.0.15

For AutoItScript, I'm using 3.3.12.0

My OS is Windows 7 Enterprise (V6.1.7601 Service pack 1) 64 bits.

That's all I can think of what might be useful.

 

 

 

 

 

 

 

If you learn from It, it's not a mistake

  • Moderators
Posted

_IEJS has been deprecated, please see:

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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