Jump to content
GATN

Java.au3 $javaferret_obj_role error

Recommended Posts

Hi!

Im trying to use Java.au3 UDF into a develop but when i hit F5 i receive an error saying  "$javaferret_obj_role: undeclared global Variable"

This part of develop its not mine so i dont understund why the error. 

I have instaled Java as i saw in other topic and dosnt work.

Any can help me?

Im working with Chrome.

Regards

Share this post


Link to post
Share on other sites

Loan

The code its the UDF indeed. Its not my code.  In My code, i only have to put #include Java.au3 and, when the Aotuit compile the include found the error...

Thanks for your reply!

Share this post


Link to post
Share on other sites

jeez ...  do you seriously think we are clairvoyant or something?

Show the code you use and also the jave UDF, as that is not something standard ..right?

Jos

 

Share this post


Link to post
Share on other sites

Ok.

Heres the code of Java.au3

#include-once
#Include <Array.au3>
#Include <GuiComboBox.au3>
#Include <GuiListBox.au3>
#Include <Tesseract.au3>
#Region Header
#cs
    Title:           Java Automation UDF Library for AutoIt3
    Filename:          Java.au3
    Description:     A collection of functions for creating, attaching to, reading from and manipulating Java applications
    Author:           seangriffin
    Version:          V0.7
    Last Update:     17/03/09
    Requirements:     AutoIt3 3.2 or higher,
                    Java Runtime Environment (JRE) 1.4 or above,
                    Java Access Bridge for the Microsoft Windows Operating System,
                    Microsoft Visual C++ 2008 Redistributable,
                    AutoIT for Java Access dynamically linked library (DLL)
                    Tesseract UDF 0.6
                    Manual check and update of the Java Access Bridge
    Changelog:        ---------26/01/09---------- v0.1
                    Initial release.
                    
                    ---------01/02/09---------- v0.2
                    Added combo box and list box support to all functions.
                    Added function "_JavaObjValuesGet".
                    Added function "_JavaObjDeselect".
                    
                    ---------17/02/09---------- v0.3
                    Fixed Java listbox and combobox suuport in _JavaObjValuesGet.
                    Parameters changed for _JavaObjValuesGet.
                    Added a dependency on the Tesseract UDF 0.4.
                    
                    ---------22/02/09---------- v0.4
                    Fixed Java listbox and combobox suuport in _JavaObjValueSet.
                    Added a dependency on the Tesseract UDF 0.5.
                    
                    ---------23/02/09---------- v0.5
                    Added function "_JavaObjPropertyGet".
                    
                    ---------15/03/09---------- v0.6
                    Added more properties to function "_JavaObjPropertyGet".
                    Bug fixed in AutoITJavaAccess.dll function JavaObjSelect where
                        action name of "Click" was not recognised.  Previously only
                        "click" (with lowercase "c" was recognised).
                    AutoITJavaAccess.dll function JavaObjValueSet enhanced to return
                        more information about the success of setting text.
                    Function _JavaObjValueSet improved to use the new JavaObjValueSet
                        return values, and use AutoIT's ControlSend function if 
                        JavaObjValueSet can set focus but not set text.
                    Added WinWait to function _JavaAttachAndWait.
                    Fixed AutoITJavaAccess.dll function findAccessibleContext to
                        handle Java windows with more than 256 Java objects.
                    Updated function "_JavaObjValueSet" to wait for the value
                        to be displayed before continuing.
                    Added function "_JavaObjIndexGet".  Useful as input into function
                        _JavaObjValueSet.
                    Added greater support to the integer form of $object_value 
                        in _JavaObjValueSet.
                    Added function "_JavaTableRowSelect".
                    Added function "_JavaTableCellSelect".
                    Added function "_JavaTableCellValueGet".
                    Added function "_JavaTableCellValueSet".
                    
                    ---------17/03/09---------- v0.7
                    Modified function "_JavaAttachAndWait" to move WinWait before
                        WinGetHandle.
                    Changed a dependency to Tesseract UDF 0.6.
#ce
#EndRegion Header
#Region Global Variables and Constants
Global $java_hwnd
Global $cntl_hwnd
#EndRegion Global Variables and Constants
#Region Core functions
; #FUNCTION# ;===============================================================================
;
; Name...........:    _JavaAttachAndWait()
; Description ...:    Attaches to a Java window.
; Syntax.........:    _JavaAttachAndWait($win_title)
; Parameters ....:    $win_title            - The title of the Java window to attach to.
;                                            This may be a substring of the full window title.
; Return values .:     On Success            - Returns True. 
;                     On Failure            - Returns False, and:
;                                            sets @ERROR = 1 if unable to find the Java window.
;                            
; Author ........:    seangriffin
; Modified.......: 
; Remarks .......:    
; Related .......: 
; Link ..........: 
; Example .......:    No
;
; ;==========================================================================================
func _JavaAttachAndWait($win_title)

    WinWait($win_title)

    $java_hwnd = WinGetHandle($win_title)

    Return True
EndFunc

; #FUNCTION# ;===============================================================================
;
; Name...........:    _JavaObjValueGet()
; Description:        Get the value of a Java object within the currently attached Java window.
; Syntax.........:    _JavaObjValueGet($autoit_cntl_id, $javaferret_obj_name = "", $javaferret_obj_role = "", $instance_num = 1)
; Parameters ....:    $autoit_cntl_id            - Optional: The AutoIT control ID of the object to get the value of.
;                                                If this is not used, then $javaferret_obj_name and/or $javaferret_obj_role must be set.
;                    $javaferret_obj_name    - Optional: The JavaFerret name of the object to get the value of.
;                                                If this is not used, then $instance_num must be set.
;                    $javaferret_obj_role    - Optional: The JavaFerret role of the object to get the value of.
;                                                If this is not used, then $autoit_cntl_id must be set.
;                    $instance_num            - Optional: The number of the instance to get the value of.
; Return values .:    On Success    - Returns the value/text of the object.
;                     On Failure    - Returns 0
; Author ........:    seangriffin
; Modified.......:    
; Remarks .......:    A prerequisite is that the function "_JavaAttachAndWait" has already been executed.
;                    This function currently supports the following Java objects:
;                        labels
;                        push buttons
;                        check boxes
;                        text (boxes)
;                        page tab lists
;                        panels
;                        combo boxes
;                        list (boxes)
;                        radio buttons
; Related .......:    
; Link ..........: 
; Example .......:    Yes
;
; ;==========================================================================================
func _JavaObjValueGet($autoit_cntl_id, $javaferret_obj_name = "", $javaferret_obj_role = "", $instance_num = 1)

    ; If an AutoIT control ID is provided
    if StringCompare($autoit_cntl_id, "") <> 0 Then
        
        $cntl_hwnd = ControlGetHandle($java_hwnd, "", $autoit_cntl_id)

        ; Try and get the values of the Java object using the Java Access bridge.
        $sss = DllCall("AutoITJavaAccess.dll", "str:cdecl", "JavaObjValueGet", "hwnd", $cntl_hwnd, "str", $javaferret_obj_name, "str", $javaferret_obj_role, "int", $instance_num)

        ; A result of "" indicates that the Java Access Bridge was unable to get values from the Java object.
        if StringCompare($sss[0], "") = 0 Then
            
            ; Combo boxes
            if StringCompare($javaferret_obj_role, "combo box") = 0 Then
        
                return _GUICtrlComboBox_GetEditText($cntl_hwnd)
            EndIf

            ; List boxes
            if StringCompare($javaferret_obj_role, "list") = 0 Then
        
                Return _GUICtrlListBox_GetText($cntl_hwnd, _GUICtrlListBox_GetCurSel($cntl_hwnd))
            EndIf
        EndIf
    Else

        ; A JavaFerret object is provided
        $sss = DllCall("AutoITJavaAccess.dll", "str:cdecl", "JavaObjValueGet", "hwnd", $java_hwnd, "str", $javaferret_obj_name, "str", $javaferret_obj_role, "int", $instance_num)
    EndIf

    Switch @error
        
        case 1
        
            ConsoleWrite("check AutoITJavaAccess.dll exists" & @CRLF)
            Exit
    EndSwitch

    Return $sss[0]
EndFunc

; #FUNCTION# ;===============================================================================
;
; Name...........:    _JavaObjValuesGet()
; Description:        Get multiple values from a Java object within the currently attached Java window.
; Syntax.........:    _JavaObjValueGet($autoit_cntl_id, $javaferret_obj_name = "", $javaferret_obj_role = "", $instance_num = 1)
; Parameters ....:    $autoit_cntl_id            - Optional: The AutoIT control ID of the object to get the values of.
;                                                If this is not used, then $javaferret_obj_name and/or $javaferret_obj_role must be set.
;                    $javaferret_obj_name    - Optional: The JavaFerret name of the object to get the values of.
;                                                If this is not used, then $instance_num must be set.
;                    $javaferret_obj_role    - Optional: The JavaFerret role of the object to get the values of.
;                                                If this is not used, then $autoit_cntl_id must be set.
;                    $instance_num            - Optional: The number of the instance to get the values of.
;
;                    Note:- The following parameters apply to Java list boxes and combo boxes that have an
;                            $autoit_cntl_id supplied.  They should be ignored for all other objects.
;
;                    $get_last_capture        - Optional: Retrieve the values of the object last time this function was called.
;                                                0 = do not retrieve the last set of values (default)
;                                                1 = retrieve the last set of values
;                    $delimiter                - Optional: The string that delimits values in the object.
;                                                A string of text will be returned if this isn't provided.
;                                                An array of delimited values will be returned if this is provided.
;                                                Eg. Use @CRLF to return the items of a listbox as an array.
;                    $expand                    - Optional: Expand the control before getting values from it?
;                                                0 = do not expand the control
;                                                1 = expand the control (default)
;                    $scrolling                - Optional: Scroll the control to get all it's values?
;                                                0 = do not scroll the control
;                                                1 = scroll the control (default)
;                    $cleanup                - Optional: Remove invalid text in the values recognised
;                                                0 = do not remove invalid text
;                                                1 = remove invalid text (default)
;                    $max_scroll_times        - Optional: The maximum number of scrolls to get the values in a control
;                                                If a control has a very long scroll bar, the
;                                                process will take too long.  Use this value to restrict
;                                                the number of values to get in a long control.
;                    $scale                    - Optional: The scaling factor to use in recognising the values to get.
;                                                Increase this number to improve accuracy.
;                                                The default is 2.
;                    $left_indent            - Optional: A number of pixels to indent from the left of the object
;                                                to improve recognition of the values in the object.
;                    $top_indent                - Optional: A number of pixels to indent from the top of the object
;                                                to improve recognition of the values in the object.
;                    $right_indent            - Optional: A number of pixels to indent from the right of the object
;                                                to improve recognition of the values in the object.
;                    $bottom_indent            - Optional: A number of pixels to indent from the bottom of the object
;                                                to improve recognition of the values in the object.
;                    $show_capture            - Optional: Display a screenshot of the object and the values
;                                                captured (for debugging purposes).
;                                                0 = do not display the screenshot of the object (default)
;                                                1 = display the screenshot of the object
; Return values .:    On Success    - Returns the value/text of the object.
;                     On Failure    - Returns 0
; Author ........:    seangriffin
; Modified.......:    
; Remarks .......:    A prerequisite is that the function "_JavaAttachAndWait" has already been executed.
;                    This function currently supports the following Java objects:
;                        combo boxes
;                        list (boxes)
; Related .......:    
; Link ..........: 
; Example .......:    Yes
;
; ;==========================================================================================
func _JavaObjValuesGet($autoit_cntl_id, $javaferret_obj_name = "", $javaferret_obj_role = "", $instance_num = 1, $get_last_capture = 0, $delimiter = "", $expand = 1, $scrolling = 1, $cleanup = 1, $max_scroll_times = 5, $scale = 2, $left_indent = 0, $top_indent = 0, $right_indent = 0, $bottom_indent = 0, $show_capture = 0)

    ; If an AutoIT control ID is provided
    if StringCompare($autoit_cntl_id, "") <> 0 Then
        
        $cntl_hwnd = ControlGetHandle($java_hwnd, "", $autoit_cntl_id)

        ; Try and get the values of the Java object using the Java Access bridge.
        $sss = DllCall("AutoITJavaAccess.dll", "str:cdecl", "JavaObjValuesGet", "hwnd", $cntl_hwnd, "str", $javaferret_obj_name, "str", $javaferret_obj_role, "int", $instance_num)

        ; A result of "", or an AutoIT control ID that is a listbox or combobox, indicates that the Java Access Bridge was unable to get values from the Java object.
        if StringCompare($sss[0], "") = 0 or (StringCompare($autoit_cntl_id, "") <> 0 and (StringCompare($javaferret_obj_role, "combo box") = 0 or StringCompare($javaferret_obj_role, "list") = 0)) Then
            
            ; Combo boxes
            if StringCompare($javaferret_obj_role, "combo box") = 0 Then

                return _TesseractControlCapture($java_hwnd, "", $autoit_cntl_id, $get_last_capture, $delimiter, $expand, $scrolling, $cleanup, $max_scroll_times, $scale, $left_indent, $top_indent, $right_indent, $bottom_indent, $show_capture)
            EndIf

            ; List boxes
            if StringCompare($javaferret_obj_role, "list") = 0 Then

                return _TesseractControlCapture($java_hwnd, "", $autoit_cntl_id, $get_last_capture, $delimiter, $expand, $scrolling, $cleanup, $max_scroll_times, $scale, $left_indent, $top_indent, $right_indent, $bottom_indent, $show_capture)
            EndIf
        EndIf
    Else

        ; A JavaFerret object is provided
        $sss = DllCall("AutoITJavaAccess.dll", "str:cdecl", "JavaObjValuesGet", "hwnd", $java_hwnd, "str", $javaferret_obj_name, "str", $javaferret_obj_role, "int", $instance_num)
        $new = StringSplit($sss[0], @CRLF, 1)
        Return $new
    EndIf

    Switch @error
        
        case 1
        
            ConsoleWrite("check AutoITJavaAccess.dll exists" & @CRLF)
            Exit
    EndSwitch

    Return $sss[0]
EndFunc

; #FUNCTION# ;===============================================================================
;
; Name...........:    _JavaObjIndexGet()
; Description:        Get the index of the selection of a Java object within the currently attached Java window.
; Syntax.........:    _JavaObjIndexGet($autoit_cntl_id, $javaferret_obj_name = "", $javaferret_obj_role = "", $instance_num = 1)
; Parameters ....:    $autoit_cntl_id            - Optional: The AutoIT control ID of the object to get the index of.
;                                                If this is not used, then $javaferret_obj_name and/or $javaferret_obj_role must be set.
;                    $javaferret_obj_name    - Optional: The JavaFerret name of the object to get the index of.
;                                                If this is not used, then $instance_num must be set.
;                    $javaferret_obj_role    - Optional: The JavaFerret role of the object to get the index of.
;                                                If this is not used, then $autoit_cntl_id must be set.
;                    $instance_num            - Optional: The number of the instance to get the index of.
; Return values .:    On Success    - Returns the 0-based index of the selection of the object.
;                     On Failure    - Returns 0
; Author ........:    seangriffin
; Modified.......:    
; Remarks .......:    A prerequisite is that the function "_JavaAttachAndWait" has already been executed.
;                    This function currently supports the following Java objects:
;                        combo boxes
;                        list (boxes)
;                    The output of this function is useful as input to the function "_JavaObjValueSet"
;                        in the parameter "$object_value".
; Related .......:    
; Link ..........: 
; Example .......:    No
;
; ;==========================================================================================
func _JavaObjIndexGet($autoit_cntl_id, $javaferret_obj_name = "", $javaferret_obj_role = "", $instance_num = 1)

    ; If an AutoIT control ID is provided
    if StringCompare($autoit_cntl_id, "") <> 0 Then
        
        $cntl_hwnd = ControlGetHandle($java_hwnd, "", $autoit_cntl_id)

        ; Try and get the values of the Java object using the Java Access bridge.
        $sss = DllCall("AutoITJavaAccess.dll", "int:cdecl", "JavaObjIndexGet", "hwnd", $java_hwnd, "str", $javaferret_obj_name, "str", $javaferret_obj_role, "int", $instance_num)

        ; A result of "" indicates that the Java Access Bridge was unable to get values from the Java object.
        if StringCompare($sss[0], "") = 0 Then
            
            ; Combo boxes
            if StringCompare($javaferret_obj_role, "combo box") = 0 Then
        
                return _GUICtrlComboBox_GetEditText($cntl_hwnd)
            EndIf

            ; List boxes
            if StringCompare($javaferret_obj_role, "list") = 0 Then
        
                Return _GUICtrlListBox_GetText($cntl_hwnd, _GUICtrlListBox_GetCurSel($cntl_hwnd))
            EndIf
        EndIf
    Else

        ; A JavaFerret object is provided
        $sss = DllCall("AutoITJavaAccess.dll", "int:cdecl", "JavaObjIndexGet", "hwnd", $java_hwnd, "str", $javaferret_obj_name, "str", $javaferret_obj_role, "int", $instance_num)
    EndIf

    Switch @error
        
        case 1
        
            ConsoleWrite("check AutoITJavaAccess.dll exists" & @CRLF)
            Exit
    EndSwitch

    Return $sss[0]
EndFunc

; #FUNCTION# ;===============================================================================
;
; Name...........:    _JavaObjValueSet()
; Description:        Set the value of a Java object within the currently attached Java window.
; Syntax.........:    _JavaObjValueSet($autoit_cntl_id, $javaferret_obj_name, $javaferret_obj_role, $object_value, $instance_num = 1, $partial = 1, $get_last_capture = 0, $delimiter = "", $expand = 1, $scrolling = 1, $cleanup = 1, $max_scroll_times = 5, $scale = 2, $left_indent = 0, $top_indent = 0, $right_indent = 0, $bottom_indent = 0, $show_capture = 0)
; Parameters ....:    $autoit_cntl_id            - Optional: The AutoIT control ID of the object to set the value for.
;                                                If this is not used, then $javaferret_obj_name and/or $javaferret_obj_role must be set.
;                    $javaferret_obj_name    - Optional: The JavaFerret name of the object to set the value for.
;                                                If this is not used, then $instance_num must be set.
;                    $javaferret_obj_role    - Optional: The JavaFerret role of the object to set the value for.
;                                                If this is not used, then $autoit_cntl_id must be set.
;                    $object_value            - The value to set the object to.
;                                                If this is a number, and $javaferret_obj_role is a "combo box" or "list",
;                                                    then this is the index of the item to select.
;                                                If this is a string, and $javaferret_obj_role is a "combo box" or "list",
;                                                    then this is the text of the item to select.
;                    $instance_num            - Optional: The number of the instance to set the value for.
;                    $wait_for_value            - Optional: A value to wait for the existence of in the Java object
;                                                before continuing.  This is useful in cases where this function ends
;                                                to quickly, and the Java Virtual Machine has not had time to 
;                                                place $object_value in the Java object.
;
;                    Note:- The following parameters apply to Java list boxes and combo boxes with a non-numeric
;                            $object_value supplied.  They should be ignored for all other objects.
;
;                    $partial                - Optional: Find the value on a partial match?
;                                                0 = select the value based on a full text match
;                                                1 = select the value based on a partial text match
;                    $get_last_capture        - Optional: Retrieve the values of the object last time this function was called.
;                                                0 = do not retrieve the last set of values (default)
;                                                1 = retrieve the last set of values
;                    $delimiter                - Optional: The string that delimits values in the object.
;                                                A string of text will be returned if this isn't provided.
;                                                An array of delimited values will be returned if this is provided.
;                                                Eg. Use @CRLF to return the items of a listbox as an array.
;                    $expand                    - Optional: Expand the control before setting it's value?
;                                                0 = do not expand the control
;                                                1 = expand the control (default)
;                    $scrolling                - Optional: Scroll the control to set it's value?
;                                                0 = do not scroll the control
;                                                1 = scroll the control (default)
;                    $cleanup                - Optional: Remove invalid text in the values recognised
;                                                0 = do not remove invalid text
;                                                1 = remove invalid text (default)
;                    $max_scroll_times        - Optional: The maximum number of scrolls to get the values in a control
;                                                If a control has a very long scroll bar, the
;                                                process will take too long.  Use this value to restrict
;                                                the number of values to get in a long control.
;                    $scale                    - Optional: The scaling factor to use in recognising the values.
;                                                Increase this number to improve accuracy.
;                                                The default is 2.
;                    $left_indent            - Optional: A number of pixels to indent from the left of the object
;                                                to improve recognition of the values in the object.
;                    $top_indent                - Optional: A number of pixels to indent from the top of the object
;                                                to improve recognition of the values in the object.
;                    $right_indent            - Optional: A number of pixels to indent from the right of the object
;                                                to improve recognition of the values in the object.
;                    $bottom_indent            - Optional: A number of pixels to indent from the bottom of the object
;                                                to improve recognition of the values in the object.
;                    $show_capture            - Optional: Display a screenshot of the object and the values
;                                                captured (for debugging purposes).
;                                                0 = do not display the screenshot of the object (default)
;                                                1 = display the screenshot of the object
; Return values .:    On Success                - Returns 1
;                     On Failure                - Returns 0
; Author ........:    seangriffin
; Modified.......:    
; Remarks .......:    A prerequisite is that the function "_JavaAttachAndWait" has already been executed.
;                    This function currently supports the following Java objects:
;                        text (boxes)
;                        combo boxes
;                        list (boxes)
;                    The output of function "_JavaObjIndexGet" can be used as input into the parameter "$object_value".
; Related .......:    
; Link ..........: 
; Example .......:    Yes
;
; ;==========================================================================================
func _JavaObjValueSet($autoit_cntl_id, $javaferret_obj_name, $javaferret_obj_role, $object_value = "", $instance_num = 1, $wait_for_value = "", $partial = 1, $get_last_capture = 0, $delimiter = "", $expand = 1, $scrolling = 1, $cleanup = 1, $max_scroll_times = 5, $scale = 2, $left_indent = 0, $top_indent = 0, $right_indent = 0, $bottom_indent = 0, $show_capture = 0)

    ; If an AutoIT control ID is provided
    if StringCompare($autoit_cntl_id, "") <> 0 Then
        
        $cntl_hwnd = ControlGetHandle($java_hwnd, "", $autoit_cntl_id)

        ; Try and set the value of the Java object using the Java Access bridge.
        $sss = DllCall("AutoITJavaAccess.dll", "int:cdecl", "JavaObjValueSet", "hwnd", $cntl_hwnd, "str", $javaferret_obj_name, "str", $javaferret_obj_role, "str", $object_value, "int", $instance_num)

        ; A result of 0 indicates that the Java Access Bridge was unable to set the value of the Java object.
        if $sss[0] = 0 Then

            ; Combo boxes
            if StringCompare($javaferret_obj_role, "combo box") = 0 Then
        
                if IsInt($object_value) Then

                    _GUICtrlComboBox_SetCurSel($cntl_hwnd, ($object_value-1))
                    return 1
                Else
                    
                    $object_index = _TesseractControlFind($java_hwnd, "", $autoit_cntl_id, $object_value, $partial, $get_last_capture, $delimiter, $expand, $scrolling, $cleanup, $max_scroll_times, $scale, $left_indent, $top_indent, $right_indent, $bottom_indent, $show_capture)
                    _GUICtrlComboBox_SetCurSel($cntl_hwnd, $object_index)
                    Return 1
                EndIf
            EndIf
            
            ; List (boxes)
            if StringCompare($javaferret_obj_role, "list") = 0 Then
        
                if IsInt($object_value) Then
                
                    _GUICtrlListBox_SetCurSel($cntl_hwnd, ($object_value-1))
                    Return 1
                Else
                    
                    $object_index = _TesseractControlFind($java_hwnd, "", $autoit_cntl_id, $object_value, $partial, $get_last_capture, $delimiter, $expand, $scrolling, $cleanup, $max_scroll_times, $scale, $left_indent, $top_indent, $right_indent, $bottom_indent, $show_capture)
                    _GUICtrlListBox_SetCurSel($cntl_hwnd, $object_index)
                    Return 1
                EndIf
            EndIf
            
            ; Other Java Objects
            ControlSetText($java_hwnd, "", $cntl_hwnd, $object_value)
        EndIf
    Else

        ; A JavaFerret object is provided

        if IsInt($object_value) Then

            $sss = DllCall("AutoITJavaAccess.dll", "int:cdecl", "JavaObjValueSet2", "hwnd", $java_hwnd, "str", $javaferret_obj_name, "str", $javaferret_obj_role, "int", $object_value, "int", $instance_num)
        Else
            
            $sss = DllCall("AutoITJavaAccess.dll", "int:cdecl", "JavaObjValueSet", "hwnd", $java_hwnd, "str", $javaferret_obj_name, "str", $javaferret_obj_role, "str", $object_value, "int", $instance_num)
        EndIf
        
        ; JavaObjValueSet return values
        ; 0 = no error
        ; 1 = request focus failed
        ; 2 = set text failed
        ; 3 = request focus & set text failed
        
        ; if set text failed, however request focus passed
        if $sss[0] = 2 Then
            
            ControlSend($java_hwnd, "", "", "{HOME}{SHIFTDOWN}{END}{SHIFTUP}" & $object_value)

            ; For slow user interfaces.
            ;    Wait until the java object displays the value before continuing.
            if StringCompare($wait_for_value, "") <> 0 Then
            
                $JavaObjValueGet_timer = TimerInit()
                while StringCompare(_JavaObjValueGet($autoit_cntl_id, $javaferret_obj_name, $javaferret_obj_role, $instance_num), $wait_for_value) <> 0 and TimerDiff($JavaObjValueGet_timer) < 20000
                    
                    sleep(500)
                WEnd
            EndIf
        EndIf
        
;        ConsoleWrite($sss[0])
;        Exit
        
    EndIf

    Switch @error
        
        case 1
        
            ConsoleWrite("check AutoITJavaAccess.dll exists" & @CRLF)
            Exit
    EndSwitch

    Return 1;
EndFunc

; #FUNCTION# ;===============================================================================
;
; Name...........:    _JavaObjSelect()
; Description:        Selects a Java object within the currently attached Java window.
; Syntax.........:    _JavaObjSelect($autoit_cntl_id, $javaferret_obj_name = "", $javaferret_obj_role = "", $instance_num = 1)
; Parameters ....:    $autoit_cntl_id            - Optional: The AutoIT control ID of the object to select.
;                                                If this is not used, then $javaferret_obj_name and/or $javaferret_obj_role must be set.
;                    $javaferret_obj_name    - Optional: The JavaFerret name of the object to select.
;                                                If this is not used, then $instance_num must be set.
;                    $javaferret_obj_role    - Optional: The JavaFerret role of the object to select.
;                                                If this is not used, then $autoit_cntl_id must be set.
;                    $instance_num            - Optional: The number of the instance to select.
; Return values .:    On Success                - Returns 1.
;                     On Failure                - Returns 0.
; Author ........:    seangriffin
; Modified.......:    
; Remarks .......:    A prerequisite is that the function "_JavaAttachAndWait" has already been executed.
;                    This function currently supports the following Java objects:
;                        push buttons
;                        check boxes
;                        radio buttons
;                        combo boxes
;                        menu
;                        menu item
;
;                    For Java applets in Internet Explorer, the ControlCommand function "Check" and 
;                        "Uncheck" functions does not produce any noticable result with checkboxes (even with prior 
;                        WinActivate or ControlFocus calls issued).
; Related .......:    
; Link ..........: 
; Example .......:    No
;
; ;==========================================================================================
func _JavaObjSelect($autoit_cntl_id, $javaferret_obj_name = "", $javaferret_obj_role = "", $instance_num = 1)

    ; If an AutoIT control ID is provided
    if StringCompare($autoit_cntl_id, "") <> 0 Then
        
        $cntl_hwnd = ControlGetHandle($java_hwnd, "", $autoit_cntl_id)

        ; Try and select the Java object using the Java Access bridge.
        $sss = DllCall("AutoITJavaAccess.dll", "int:cdecl", "JavaObjSelect", "hwnd", $cntl_hwnd, "str", $javaferret_obj_name, "str", $javaferret_obj_role, "int", $instance_num)
        
        ; A result of 0 indicates that the Java Access Bridge was unable to select the Java object.
        if $sss[0] = 0 Then

            ; Combo boxes
            if StringCompare($javaferret_obj_role, "combo box") = 0 Then
        
                ControlCommand($java_hwnd, "", $cntl_hwnd, "ShowDropDown", "")
            EndIf

            ; Check boxes
            if StringCompare($javaferret_obj_role, "check box") = 0 Then

                ; Loop until the Java Access Bridge reports that the checkbox in unchecked.
                ; Note that ControlCommand "IsChecked" does not seem to work with Java applets.
                while StringCompare(_JavaObjValueGet($autoit_cntl_id), "unchecked") = 0

                    ; All the following three commands are the only way I am able to toggle applet checkboxes.
                    ; I cannot find a Java Access Bridge function to toggle applet checkboxes.
                    WinActivate($java_hwnd)
                    ControlFocus($java_hwnd, "", $cntl_hwnd)
                    ControlSend($java_hwnd, "", $cntl_hwnd, " ")
                    WinWait($java_hwnd)
                WEnd
            EndIf
        EndIf
    Else

        $sss = DllCall("AutoITJavaAccess.dll", "int:cdecl", "JavaObjSelect", "hwnd", $java_hwnd, "str", $javaferret_obj_name, "str", $javaferret_obj_role, "int", $instance_num)
    EndIf

    Switch @error
        
        case 1
        
            ConsoleWrite("check AutoITJavaAccess.dll exists" & @CRLF)

        case 2
        
            ConsoleWrite("check AutoITJavaAccess.dll exists" & @CRLF)

        case 3
        
            ConsoleWrite("Function ""JavaObjSelect"" not found in ""AutoITJavaAccess.dll""" & @CRLF)

    EndSwitch


    Return 1;

EndFunc

; #FUNCTION# ;===============================================================================
;
; Name...........:    _JavaObjDeselect()
; Description:        Deselects a Java object within the currently attached Java window.
; Syntax.........:    _JavaObjSelect($autoit_cntl_id, $javaferret_obj_name = "", $javaferret_obj_role = "", $instance_num = 1)
; Parameters ....:    $autoit_cntl_id            - Optional: The AutoIT control ID of the object to deselect.
;                                                If this is not used, then $javaferret_obj_name and/or $javaferret_obj_role must be set.
;                    $javaferret_obj_name    - Optional: The JavaFerret name of the object to deselect.
;                                                If this is not used, then $instance_num must be set.
;                    $javaferret_obj_role    - Optional: The JavaFerret role of the object to deselect.
;                                                If this is not used, then $autoit_cntl_id must be set.
;                    $instance_num            - Optional: The number of the instance to deselect.
; Return values .:    On Success                - Returns 1.
;                     On Failure                - Returns 0.
; Author ........:    seangriffin
; Modified.......:    
; Remarks .......:    A prerequisite is that the function "_JavaAttachAndWait" has already been executed.
;                    This function currently supports the following Java objects:
;                        push buttons
;                        check boxes
;                        radio buttons
;                        combo boxes
;
;                    For Java applets in Internet Explorer, the ControlCommand function "Check" and 
;                        "Uncheck" functions does not produce any noticable result with checkboxes (even with prior 
;                        WinActivate or ControlFocus calls issued).
; Related .......:    
; Link ..........: 
; Example .......:    No
;
; ;==========================================================================================
func _JavaObjDeselect($autoit_cntl_id, $javaferret_obj_name = "", $javaferret_obj_role = "", $instance_num = 1)

    ; If an AutoIT control ID is provided
    if StringCompare($autoit_cntl_id, "") <> 0 Then
        
        $cntl_hwnd = ControlGetHandle($java_hwnd, "", $autoit_cntl_id)

        ; Try and select the Java object using the Java Access bridge.
        $sss = DllCall("AutoITJavaAccess.dll", "int:cdecl", "JavaObjDeselect", "hwnd", $cntl_hwnd, "str", $javaferret_obj_name, "str", $javaferret_obj_role, "int", $instance_num)
        
        ; A result of 0 indicates that the Java Access Bridge was unable to deselect the Java object.
        if $sss[0] = 0 Then

            ; Combo boxes
            if StringCompare($javaferret_obj_role, "combo box") = 0 Then
        
                ControlCommand($java_hwnd, "", $cntl_hwnd, "HideDropDown", "")
            EndIf

            ; Check boxes
            if StringCompare($javaferret_obj_role, "check box") = 0 Then

                ; Loop until the Java Access Bridge reports that the checkbox in unchecked.
                ; Note that ControlCommand "IsChecked" does not seem to work with Java applets.
                while StringCompare(_JavaObjValueGet($autoit_cntl_id), "unchecked") = 0

                    ; All the following three commands are the only way I am able to toggle applet checkboxes.
                    ; I cannot find a Java Access Bridge function to toggle applet checkboxes.
                    WinActivate($java_hwnd)
                    ControlFocus($java_hwnd, "", $cntl_hwnd)
                    ControlSend($java_hwnd, "", $cntl_hwnd, " ")
                    WinWait($java_hwnd)
                WEnd
            EndIf
        EndIf

;            $sss = DllCall("AutoITJavaAccess.dll", "int:cdecl", "JavaObjValueSet", "hwnd", $cntl_hwnd, "str", "", "str", "", "str", $object_value, "int", $instance_num)
    Else

        $sss = DllCall("AutoITJavaAccess.dll", "int:cdecl", "JavaObjDeselect", "hwnd", $java_hwnd, "str", $javaferret_obj_name, "str", $javaferret_obj_role, "int", $instance_num)
    EndIf

    Switch @error
        
        case 1
        
            ConsoleWrite("check AutoITJavaAccess.dll exists" & @CRLF)

        case 2
        
            ConsoleWrite("check AutoITJavaAccess.dll exists" & @CRLF)

        case 3
        
            ConsoleWrite("Function ""JavaObjSelect"" not found in ""AutoITJavaAccess.dll""" & @CRLF)

    EndSwitch


    Return 1;

EndFunc

; #FUNCTION# ;===============================================================================
;
; Name...........:    _JavaObjPropertyGet()
; Description:        Get the value of a property in a Java object within the currently attached Java window.
; Syntax.........:    _JavaObjPropertyGet($autoit_cntl_id, $javaferret_obj_name = "", $javaferret_obj_role = "", $instance_num = 1, $property_name = "")
; Parameters ....:    $autoit_cntl_id            - Optional: The AutoIT control ID of the object to get the property value of.
;                                                If this is not used, then $javaferret_obj_name and/or $javaferret_obj_role must be set.
;                    $javaferret_obj_name    - Optional: The JavaFerret name of the object to get the property value of.
;                                                If this is not used, then $instance_num must be set.
;                    $javaferret_obj_role    - Optional: The JavaFerret role of the object to get the property value of.
;                                                If this is not used, then $autoit_cntl_id must be set.
;                    $instance_num            - Optional: The number of the instance to get the property value of.
;                    $property_name            - The name of the property to get the value of.
;                                                See the "Remarks" section below for valid property names.
; Return values .:    On Success    - Returns the value/text of the property.
;                     On Failure    - Returns 0
; Author ........:    seangriffin
; Modified.......:    
; Remarks .......:    A prerequisite is that the function "_JavaAttachAndWait" has already been executed.
;                    This function currently supports the following properties:
;                        Name
;                        Description
;                        Role
;                        Role in en_US locale
;                        States
;                        States in en_US locale
;                        Index in parent
;                        Children count
;                        Bounding rectangle
;                        Top-level window name
;                        Top-level window role
;                        Parent name
;                        Parent role
;                        Visible descendents count
;                        Number of actions
;                        Action <n> name
;                        Mouse point at text index
;                        Caret at text index
;                        Char count
;                        Selection start index
;                        Selection end index
;                        Selected text
;                        Character bounding rectangle
;                        Line bounds
;                        Character
;                        Word
;                        Sentence
;                        Core attributes
;                        Background color
;                        Foreground color
;                        Font family
;                        Font size
;                        First line indent
;                        Left indent
;                        Right indent
;                        Line spacing
;                        Space above
;                        Space below
;                        Full attribute string
;                        Attribute run
; Related .......:    
; Link ..........: 
; Example .......:    Yes
;
; ;==========================================================================================
func _JavaObjPropertyGet($autoit_cntl_id, $javaferret_obj_name = "", $javaferret_obj_role = "", $instance_num = 1, $property_name = "")

    ; If an AutoIT control ID is provided
    if StringCompare($autoit_cntl_id, "") <> 0 Then
        
        $cntl_hwnd = ControlGetHandle($java_hwnd, "", $autoit_cntl_id)

        ; Try and get the property of the Java object using the Java Access bridge.
        $sss = DllCall("AutoITJavaAccess.dll", "str:cdecl", "JavaObjPropertyGet", "hwnd", $java_hwnd, "str", $javaferret_obj_name, "str", $javaferret_obj_role, "int", $instance_num, "str", $property_name)

        ; A result of "" indicates that the Java Access Bridge was unable to get values from the Java object.
        if StringCompare($sss[0], "") = 0 Then

            if StringCompare($property_name, "Bounding rectangle") = 0 Then
            
                $cntl_pos = ControlGetPos($java_hwnd, "", $autoit_cntl_id)
                $sss[0] = _ArrayToString($cntl_pos, ",")
            EndIf

            ; Combo boxes
            if StringCompare($javaferret_obj_role, "combo box") = 0 Then
        
                return _GUICtrlComboBox_GetEditText($cntl_hwnd)
            EndIf

            ; List boxes
            if StringCompare($javaferret_obj_role, "list") = 0 Then
        
                Return _GUICtrlListBox_GetText($cntl_hwnd, _GUICtrlListBox_GetCurSel($cntl_hwnd))
            EndIf
        EndIf
    Else

        ; A JavaFerret object is provided
        $sss = DllCall("AutoITJavaAccess.dll", "str:cdecl", "JavaObjPropertyGet", "hwnd", $java_hwnd, "str", $javaferret_obj_name, "str", $javaferret_obj_role, "int", $instance_num, "str", $property_name)
    EndIf

    Switch @error
        
        case 1
        
            ConsoleWrite("check AutoITJavaAccess.dll exists" & @CRLF)
            Exit
    EndSwitch

    Return $sss[0]
EndFunc

; #FUNCTION# ;===============================================================================
;
; Name...........:    _JavaTableRowSelect()
; Description:        Selects a row within a Java table within the currently attached Java window.
; Syntax.........:    _JavaTableRowSelect($autoit_cntl_id, $javaferret_obj_name = "", $instance_num = 1, $javaferret_panel_name = "", $panel_instance_num = 1, $col_names = "", $col_values = "")
; Parameters ....:    $autoit_cntl_id            - Optional: The AutoIT control ID of the table to select the row within.
;                                                If this is not used, then $javaferret_obj_name and/or $javaferret_obj_role must be set.
;                    $javaferret_obj_name    - Optional: The JavaFerret name of the table to select the row within.
;                                                If this is not used, then $instance_num must be set.
;                    $instance_num            - Optional: The instance of the table to select the row within.
;                    $javaferret_panel_name    - The JavaFerret panel name containing the table headings.
;                    $panel_instance_num        - Optional: The instance of the panel that contains the
;                                                table headings.
;                    $col_names                - A comma seperated list of column names used to find the row to select.
;                    $col_values                - A comma seperated list of cell values (for the column names provided
;                                                in $col_names) used to find the row to select.
; Return values .:    On Success                - Returns 1.
;                     On Failure                - Returns 0.
; Author ........:    seangriffin
; Modified.......:    
; Remarks .......:    A prerequisite is that the function "_JavaAttachAndWait" has already been executed.
; Related .......:    
; Link ..........: 
; Example .......:    No
;
; ;==========================================================================================
func _JavaTableRowSelect($autoit_cntl_id, $javaferret_obj_name = "", $instance_num = 1, $javaferret_panel_name = "", $panel_instance_num = 1, $col_names = "", $col_values = "")

    ; If an AutoIT control ID is provided
    if StringCompare($autoit_cntl_id, "") <> 0 Then
        
        $cntl_hwnd = ControlGetHandle($java_hwnd, "", $autoit_cntl_id)

        ; Try and select the Java object using the Java Access bridge.
        $sss = DllCall("AutoITJavaAccess.dll", "int:cdecl", "JavaTableRowGet", "hwnd", $cntl_hwnd, "str", $javaferret_obj_name, "int", $instance_num)
        
        ; A result of 0 indicates that the Java Access Bridge was unable to select the Java object.
        if $sss[0] = 0 Then

            ; Combo boxes
            if StringCompare($javaferret_obj_role, "combo box") = 0 Then
        
                ControlCommand($java_hwnd, "", $cntl_hwnd, "ShowDropDown", "")
            EndIf

            ; Check boxes
            if StringCompare($javaferret_obj_role, "check box") = 0 Then

                ; Loop until the Java Access Bridge reports that the checkbox in unchecked.
                ; Note that ControlCommand "IsChecked" does not seem to work with Java applets.
                while StringCompare(_JavaObjValueGet($autoit_cntl_id), "unchecked") = 0

                    ; All the following three commands are the only way I am able to toggle applet checkboxes.
                    ; I cannot find a Java Access Bridge function to toggle applet checkboxes.
                    WinActivate($java_hwnd)
                    ControlFocus($java_hwnd, "", $cntl_hwnd)
                    ControlSend($java_hwnd, "", $cntl_hwnd, " ")
                    WinWait($java_hwnd)
                WEnd
            EndIf
        EndIf
    Else

        $sss = DllCall("AutoITJavaAccess.dll", "int:cdecl", "JavaTableRowGet", "hwnd", $java_hwnd, "str", $javaferret_obj_name, "int", $instance_num, "str", $javaferret_panel_name, "int", $panel_instance_num, "str", $col_names, "str", $col_values)
        ConsoleWrite("r" & $sss[0])

        ; Press the DOWN key the correct number of times to reach the row.
        if $sss[0] > 0 Then
            
            WinActivate($java_hwnd)
            ControlFocus($java_hwnd, "", "")
            ControlSend($java_hwnd, "", "", "{DOWN " & $sss[0] & "}")
        EndIf
    EndIf

    Switch @error
        
        case 1
        
            ConsoleWrite("check AutoITJavaAccess.dll exists" & @CRLF)

        case 2
        
            ConsoleWrite("check AutoITJavaAccess.dll exists" & @CRLF)

        case 3
        
            ConsoleWrite("Function ""JavaObjSelect"" not found in ""AutoITJavaAccess.dll""" & @CRLF)

    EndSwitch


    Return 1;

EndFunc

; #FUNCTION# ;===============================================================================
;
; Name...........:    _JavaTableCellSelect()
; Description:        Selects a cell within a Java table within the currently attached Java window.
; Syntax.........:    _JavaTableCellSelect($autoit_cntl_id, $javaferret_obj_name = "", $instance_num = 1, $javaferret_panel_name = "", $panel_instance_num = 1, $col_names = "", $col_values = "", $col_name_select = "")
; Parameters ....:    $autoit_cntl_id            - Optional: The AutoIT control ID of the table to select the cell within.
;                                                If this is not used, then $javaferret_obj_name and/or $javaferret_obj_role must be set.
;                    $javaferret_obj_name    - Optional: The JavaFerret name of the table to select the cell within.
;                                                If this is not used, then $instance_num must be set.
;                    $instance_num            - Optional: The instance of the table to select the cell within.
;                    $javaferret_panel_name    - The JavaFerret panel name containing the table headings.
;                    $panel_instance_num        - Optional: The instance of the panel that contains the
;                                                table headings.
;                    $col_names                - A comma seperated list of column names used to find the row to select the cell within.
;                    $col_values                - A comma seperated list of cell values (for the column names provided
;                                                in $col_names) used to find the row to select the cell within.
;                    $col_name_select        - The column name of the cell to select.
; Return values .:    On Success                - Returns 1.
;                     On Failure                - Returns 0.
; Author ........:    seangriffin
; Modified.......:    
; Remarks .......:    A prerequisite is that the function "_JavaAttachAndWait" has already been executed.
; Related .......:    
; Link ..........: 
; Example .......:    No
;
; ;==========================================================================================
func _JavaTableCellSelect($autoit_cntl_id, $javaferret_obj_name = "", $instance_num = 1, $javaferret_panel_name = "", $panel_instance_num = 1, $col_names = "", $col_values = "", $col_name_select = "")

    ; If an AutoIT control ID is provided
    if StringCompare($autoit_cntl_id, "") <> 0 Then
        
        $cntl_hwnd = ControlGetHandle($java_hwnd, "", $autoit_cntl_id)

        ; Try and select the Java object using the Java Access bridge.
        $sss = DllCall("AutoITJavaAccess.dll", "int:cdecl", "JavaObjSelect", "hwnd", $cntl_hwnd, "str", "", "str", "", "int", $instance_num)
        
        ; A result of 0 indicates that the Java Access Bridge was unable to select the Java object.
        if $sss[0] = 0 Then

            ; Combo boxes
            if StringCompare($javaferret_obj_role, "combo box") = 0 Then
        
                ControlCommand($java_hwnd, "", $cntl_hwnd, "ShowDropDown", "")
            EndIf

            ; Check boxes
            if StringCompare($javaferret_obj_role, "check box") = 0 Then

                ; Loop until the Java Access Bridge reports that the checkbox in unchecked.
                ; Note that ControlCommand "IsChecked" does not seem to work with Java applets.
                while StringCompare(_JavaObjValueGet($autoit_cntl_id), "unchecked") = 0

                    ; All the following three commands are the only way I am able to toggle applet checkboxes.
                    ; I cannot find a Java Access Bridge function to toggle applet checkboxes.
                    WinActivate($java_hwnd)
                    ControlFocus($java_hwnd, "", $cntl_hwnd)
                    ControlSend($java_hwnd, "", $cntl_hwnd, " ")
                    WinWait($java_hwnd)
                WEnd
            EndIf
        EndIf
    Else

        $sss = DllCall("AutoITJavaAccess.dll", "int:cdecl", "JavaTableRowGet", "hwnd", $java_hwnd, "str", $javaferret_obj_name, "int", $instance_num, "str", $javaferret_panel_name, "int", $panel_instance_num, "str", $col_names, "str", $col_values)
        $sss2 = DllCall("AutoITJavaAccess.dll", "int:cdecl", "JavaTableColGet", "hwnd", $java_hwnd, "str", $javaferret_panel_name, "int", $panel_instance_num, "str", $col_name_select)

        ; Press the DOWN key the correct number of times to reach the row.
        WinActivate($java_hwnd)
        ControlFocus($java_hwnd, "", "")
        ControlSend($java_hwnd, "", "", "{DOWN " & $sss[0] & "}")
        ControlSend($java_hwnd, "", "", "{RIGHT " & $sss2[0] & "}")
    EndIf

    Switch @error
        
        case 1
        
            ConsoleWrite("check AutoITJavaAccess.dll exists" & @CRLF)

        case 2
        
            ConsoleWrite("check AutoITJavaAccess.dll exists" & @CRLF)

        case 3
        
            ConsoleWrite("Function ""JavaObjSelect"" not found in ""AutoITJavaAccess.dll""" & @CRLF)

    EndSwitch


    Return 1;

EndFunc

; #FUNCTION# ;===============================================================================
;
; Name...........:    _JavaTableCellValueGet()
; Description:        Gets the value of a cell within a Java table within the currently attached Java window.
; Syntax.........:    _JavaTableCellValueGet($autoit_cntl_id, $javaferret_obj_name = "", $instance_num = 1, $javaferret_panel_name = "", $panel_instance_num = 1, $col_names = "", $col_values = "", $col_name_select = "")
; Parameters ....:    $autoit_cntl_id            - Optional: The AutoIT control ID of the table to get the value from.
;                                                If this is not used, then $javaferret_obj_name and/or $javaferret_obj_role must be set.
;                    $javaferret_obj_name    - Optional: The JavaFerret name of the table to get the value from.
;                                                If this is not used, then $instance_num must be set.
;                    $instance_num            - Optional: The instance of the table to get the value from.
;                    $javaferret_panel_name    - The JavaFerret panel name containing the table headings.
;                    $panel_instance_num        - Optional: The instance of the panel that contains the
;                                                table headings.
;                    $col_names                - A comma seperated list of column names used to find the row to get the value from.
;                    $col_values                - A comma seperated list of cell values (for the column names provided
;                                                in $col_names) used to find the row to get the value from.
;                    $col_name_select        - The column name of the cell to get the value from.
; Return values .:    On Success                - The value of the cell.
;                     On Failure                - Returns "".
; Author ........:    seangriffin
; Modified.......:    
; Remarks .......:    A prerequisite is that the function "_JavaAttachAndWait" has already been executed.
; Related .......:    
; Link ..........: 
; Example .......:    No
;
; ;==========================================================================================
func _JavaTableCellValueGet($autoit_cntl_id, $javaferret_obj_name = "", $instance_num = 1, $javaferret_panel_name = "", $panel_instance_num = 1, $col_names = "", $col_values = "", $col_name_select = "")

    ; If an AutoIT control ID is provided
    if StringCompare($autoit_cntl_id, "") <> 0 Then
        
        $cntl_hwnd = ControlGetHandle($java_hwnd, "", $autoit_cntl_id)

        ; Try and select the Java object using the Java Access bridge.
        $sss = DllCall("AutoITJavaAccess.dll", "int:cdecl", "JavaObjSelect", "hwnd", $cntl_hwnd, "str", "", "str", "", "int", $instance_num)
        
        ; A result of 0 indicates that the Java Access Bridge was unable to select the Java object.
        if $sss[0] = 0 Then

            ; Combo boxes
            if StringCompare($javaferret_obj_role, "combo box") = 0 Then
        
                ControlCommand($java_hwnd, "", $cntl_hwnd, "ShowDropDown", "")
            EndIf

            ; Check boxes
            if StringCompare($javaferret_obj_role, "check box") = 0 Then

                ; Loop until the Java Access Bridge reports that the checkbox in unchecked.
                ; Note that ControlCommand "IsChecked" does not seem to work with Java applets.
                while StringCompare(_JavaObjValueGet($autoit_cntl_id), "unchecked") = 0

                    ; All the following three commands are the only way I am able to toggle applet checkboxes.
                    ; I cannot find a Java Access Bridge function to toggle applet checkboxes.
                    WinActivate($java_hwnd)
                    ControlFocus($java_hwnd, "", $cntl_hwnd)
                    ControlSend($java_hwnd, "", $cntl_hwnd, " ")
                    WinWait($java_hwnd)
                WEnd
            EndIf
        EndIf
    Else

        $sss = DllCall("AutoITJavaAccess.dll", "str:cdecl", "JavaTableCellGet", "hwnd", $java_hwnd, "str", $javaferret_obj_name, "int", $instance_num, "str", $javaferret_panel_name, "int", $panel_instance_num, "str", $col_names, "str", $col_values, "str", $col_name_select)
        
        ; Some Java apps return the "Column Name" and "Value" in the cell name.
        ;    Strip off these labels.
        if StringCompare(StringLeft($sss[0], 12), "Column Name ") = 0 Then
            
            $sss[0] = StringMid($sss[0], StringInStr($sss[0], " Value ") + StringLen(" Value "))
        EndIf
    EndIf

    Switch @error
        
        case 1
        
            ConsoleWrite("check AutoITJavaAccess.dll exists" & @CRLF)

        case 2
        
            ConsoleWrite("check AutoITJavaAccess.dll exists" & @CRLF)

        case 3
        
            ConsoleWrite("Function ""JavaObjSelect"" not found in ""AutoITJavaAccess.dll""" & @CRLF)

    EndSwitch


    Return $sss[0];

EndFunc

; #FUNCTION# ;===============================================================================
;
; Name...........:    _JavaTableCellValueSet()
; Description:        Sets the value of a cell within a Java table within the currently attached Java window.
; Syntax.........:    _JavaTableCellValueSet($autoit_cntl_id, $javaferret_obj_name = "", $instance_num = 1, $javaferret_panel_name = "", $panel_instance_num = 1, $col_names = "", $col_values = "", $col_name_select = "", $object_value = "")
; Parameters ....:    $autoit_cntl_id            - Optional: The AutoIT control ID of the table to set the value within.
;                                                If this is not used, then $javaferret_obj_name and/or $javaferret_obj_role must be set.
;                    $javaferret_obj_name    - Optional: The JavaFerret name of the table to set the value within.
;                                                If this is not used, then $instance_num must be set.
;                    $instance_num            - Optional: The instance of the table to set the value within.
;                    $javaferret_panel_name    - The JavaFerret panel name containing the table headings.
;                    $panel_instance_num        - Optional: The instance of the panel that contains the
;                                                table headings.
;                    $col_names                - A comma seperated list of column names used to find the row to get the value from.
;                    $col_values                - A comma seperated list of cell values (for the column names provided
;                                                in $col_names) used to find the row to set the value within.
;                    $col_name_select        - The column name of the cell to set the value of.
; Return values .:    On Success                - Returns 1.
;                     On Failure                - Returns 0.
; Author ........:    seangriffin
; Modified.......:    
; Remarks .......:    A prerequisite is that the function "_JavaAttachAndWait" has already been executed.
; Related .......:    
; Link ..........: 
; Example .......:    No
;
; ;==========================================================================================
func _JavaTableCellValueSet($autoit_cntl_id, $javaferret_obj_name = "", $instance_num = 1, $javaferret_panel_name = "", $panel_instance_num = 1, $col_names = "", $col_values = "", $col_name_select = "", $object_value = "")

    ; If an AutoIT control ID is provided
    if StringCompare($autoit_cntl_id, "") <> 0 Then
        
        $cntl_hwnd = ControlGetHandle($java_hwnd, "", $autoit_cntl_id)

        ; Try and select the Java object using the Java Access bridge.
        $sss = DllCall("AutoITJavaAccess.dll", "int:cdecl", "JavaObjSelect", "hwnd", $cntl_hwnd, "str", "", "str", "", "int", $instance_num)
        
        ; A result of 0 indicates that the Java Access Bridge was unable to select the Java object.
        if $sss[0] = 0 Then

            ; Combo boxes
            if StringCompare($javaferret_obj_role, "combo box") = 0 Then
        
                ControlCommand($java_hwnd, "", $cntl_hwnd, "ShowDropDown", "")
            EndIf

            ; Check boxes
            if StringCompare($javaferret_obj_role, "check box") = 0 Then

                ; Loop until the Java Access Bridge reports that the checkbox in unchecked.
                ; Note that ControlCommand "IsChecked" does not seem to work with Java applets.
                while StringCompare(_JavaObjValueGet($autoit_cntl_id), "unchecked") = 0

                    ; All the following three commands are the only way I am able to toggle applet checkboxes.
                    ; I cannot find a Java Access Bridge function to toggle applet checkboxes.
                    WinActivate($java_hwnd)
                    ControlFocus($java_hwnd, "", $cntl_hwnd)
                    ControlSend($java_hwnd, "", $cntl_hwnd, " ")
                    WinWait($java_hwnd)
                WEnd
            EndIf
        EndIf
    Else

        ; if the column names to search are numerical (indexes)
        if StringRegExp($col_names, "[a-zA-Z]") = 0 Then
            
            $sss = DllCall("AutoITJavaAccess.dll", "int:cdecl", "JavaTableRowGet2", "hwnd", $java_hwnd, "str", $javaferret_obj_name, "int", $instance_num, "str", $col_names, "str", $col_values)
        Else

            $sss = DllCall("AutoITJavaAccess.dll", "int:cdecl", "JavaTableRowGet", "hwnd", $java_hwnd, "str", $javaferret_obj_name, "int", $instance_num, "str", $javaferret_panel_name, "int", $panel_instance_num, "str", $col_names, "str", $col_values)
        EndIf

        $row_num_set = $sss[0]
;        ConsoleWrite("r" & $row_num_set)

        ; if the column name to set is numerical (an index)
        if StringIsDigit($col_name_select) = 1 Then
            
            $col_num_set = $col_name_select
        Else
            
            $sss2 = DllCall("AutoITJavaAccess.dll", "int:cdecl", "JavaTableColGet", "hwnd", $java_hwnd, "str", $javaferret_panel_name, "int", $panel_instance_num, "str", $col_name_select)
            $col_num_set = $sss2[0]
        EndIf

;        ConsoleWrite("t" & $col_num_set)

        ; Press the DOWN key the correct number of times to reach the row.
        WinActivate($java_hwnd)
        ControlFocus($java_hwnd, "", "")
        
        if $row_num_set > 0 Then
        
            ControlSend($java_hwnd, "", "", "{DOWN " & $row_num_set & "}")
        EndIf
            
        if $col_num_set > 0 Then
            
            ControlSend($java_hwnd, "", "", "{RIGHT " & $col_num_set & "}")
        EndIf
        
        ControlSend($java_hwnd, "", "", $object_value)
    EndIf

    Switch @error
        
        case 1
        
            ConsoleWrite("check AutoITJavaAccess.dll exists" & @CRLF)

        case 2
        
            ConsoleWrite("check AutoITJavaAccess.dll exists" & @CRLF)

        case 3
        
            ConsoleWrite("Function ""JavaObjSelect"" not found in ""AutoITJavaAccess.dll""" & @CRLF)

    EndSwitch


    Return $sss[0];

EndFunc

 

Edited by Jos

Share this post


Link to post
Share on other sites

The first error appears on this part:

 

        if $sss[0] = 0 Then

            ; Combo boxes
            if StringCompare($javaferret_obj_role, "combo box") = 0 Then
        
                ControlCommand($java_hwnd, "", $cntl_hwnd, "ShowDropDown", "")
            EndIf

Share this post


Link to post
Share on other sites

Please enclose your code in AutoIt code tags (the "<>" icon in the editor). That greatly enhances readability ;)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (NEW 2019-10-09 - Version 0.9.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

$javaferret_obj_role is used multiple times in the UDF and always but one time is passed as a parameter. Looks like a bug to me?
If you do not need function _JavaTableRowSelect, simply remove it from the UDF.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (NEW 2019-10-09 - Version 0.9.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

OK... here's my code:

#region --- Au3Recorder generated code Start (v3.3.9.5 KeyboardLayout=0000040A)  ---
#Include <Array.au3>
#Include <Chrome.au3>
#Include <Java.au3>



#region --- Internal functions Au3Recorder Start ---
Func _Au3RecordSetup()
Opt('WinWaitDelay',100)
Opt('WinDetectHiddenText',1)
Opt('MouseCoordMode',0)
Local $aResult = DllCall('User32.dll', 'int', 'GetKeyboardLayoutNameW', 'wstr', '')
If $aResult[1] <> '0000040A' Then
  MsgBox(64, 'Warning', 'Recording has been done under a different Keyboard layout' & @CRLF & '(0000040A->' & $aResult[1] & ')')
EndIf

EndFunc

Func _WinWaitActivate($title,$text,$timeout=0)
    WinWait($title,$text,$timeout)
    If Not WinActive($title,$text) Then WinActivate($title,$text)
    WinWaitActive($title,$text,$timeout)
EndFunc

_AU3RecordSetup()
#endregion --- Internal functions Au3Recorder End ---



_ChromeStartup("https://www.emp.santanderrio.com.ar/nb/")


;~ _ChromeDocWaitForExistenceByTitle("Nueva pestaña - Google Chrome","5")


_ChromeDocWaitForExistenceByTitle("https://www.emp.santanderrio.com.ar/nb/ - Google Chrome","5")

MouseClick("left",1042,10,1)

_WinWaitActivate("Santander Río - Google Chrome","")

_ChromeDocWaitForExistenceByTitle("Santander Río - Google Chrome","5")

Sleep(400)
MouseClick("left",48,122,1)

Sleep(400)

MouseClick("left",208,188,1)

MouseMove(1355,272)
MouseDown("left")
MouseMove(1367,675)
Sleep(400)
MouseUp("left")
MouseClick("left",491,298,1)
MouseClick("left",417,380,1)
MouseClick("left",380,334,1)
MouseClick("left",308,386,1)
Send("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{ENTER}")
MouseMove(1356,295)
MouseDown("left")
MouseMove(1367,641)
MouseUp("left")
MouseClick("left",181,339,1)
MouseClick("left",1340,92,1)
#endregion --- Au3Recorder generated code End ---

 

Edited by GATN

Share this post


Link to post
Share on other sites

Why did you not use the codebox or did you miss that part of the information provided?

Jos

Share this post


Link to post
Share on other sites

Jos

I did not use any java statement in my code. I just include into.

Im sorry but i dont know what is the codebox....

All the code that i pasted its the code that i have.

Share this post


Link to post
Share on other sites

When posting your code you click on the <> button at the top of your forum editor and past the autoit3 script in the window that pops-up..

It will than be shown as your UDF which I edited for you, and make it much more readable. :)

Jos

Edited by Jos

Share this post


Link to post
Share on other sites

Which part of my sentence was confusing? Thought it was pretty short/sweet/strait forward. :)

Jos

Share this post


Link to post
Share on other sites

Please check this link about "How to post code":

Edit:
And this is exactly what I've posted here:

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2019-08-19 - Version 1.4.13.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2019-07-24 - Version 1.3.6.0) - Download - General Help & Support - Example Scripts - Wiki
Outlook Tools (NEW 2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (NEW 2019-10-09 - Version 0.9.0.0) - Download - General Help & Support - Wiki

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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

  • Similar Content

    • By nooneclose
      Good morning, all. I am having a very hard time figuring out why my code "breaks" every second (and every time after) iteration in the loop. 
      I am trying to automate the process of filling out a form for work. I need to find and send data to seven fields and get data from one field. 
      Here are a couple of pictures of the fields I am interacting with. The fields are on the same forum/page. (the green boxed ones)
       


      Here is my code so far. 
       
      #AutoIt3Wrapper_Au3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 ;Allows for the combining of UDFs by disabling error messages. (I get error messages for "problems" that dont actually exsist) #include <AD.au3> ;Allows Active Directory functions #include <Array.au3> ;Allows special Array functions #include <Constants.au3> ;Allows constants to be used #include <Date.au3> ;Allows Date and Time functions #include <DateTimeConstants.au3> ;Allows Date and Time constant functions #include "DTC.au3" ;Allows Custom Date and Time functions #include <IE.au3> ;Allows Internet Explorer functions #include <Misc.au3> ;Allows the "is pressed" function to be used #include <MsgBoxConstants.au3> ;Allows Message box function to be used #include <OutlookEX.au3> ;Allows the Outlook functions #include <String.au3> ;Allows special string functions #include <StringConstants.au3> ;Allows String constant functions #include <Timers.au3> ;Allows timer functions ;#RequireAdmin ;Requests admin privliges before starting program ; Special UDFs for UIA automation #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <debug.au3> #include <WinAPI.au3> #include "UIAWrappers.au3" #AutoIt3Wrapper_UseX64=N ;Should be used for stuff like tagpoint having right struct etc. when running on a 64 bits os ;******************************************************************************* ; Format and send the vaild E-mail's contents ;******************************************************************************* Func SendEmailData() ConsoleWrite("Action 16: Send E-mail Data to it's proper fields" & " at line: " & @ScriptLineNumber & @CRLF) ;=============================================================================== ; Store the Elements ;=============================================================================== ; Description _UIA_setVar("oDescription","Title:=Description:;controltype:=UIA_EditControlTypeId;class:=") ; Long Description OK Button _UIA_setVar("oLongButton","Title:=Long Description;controltype:=UIA_ImageControlTypeId;class:=") _UIA_setVar("oLongOk","Title:=OK;controltype:=UIA_ButtonControlTypeId;class:=") ; Work Order Number _UIA_setVar("oWorkOrderNum","Title:=Work Order:;controltype:=UIA_EditControlTypeId;class:=") ; Location _UIA_setVar("oLocation","Title:=Location:;controltype:=UIA_EditControlTypeId;class:=") ; Work Type _UIA_setVar("oWorkType","Title:=Work Type:;controltype:=UIA_EditControlTypeId;class:=") ; Reported By Date _UIA_setVar("oDate","Title:=Reported Date:;controltype:=UIA_EditControlTypeId;class:=") ; Reported By Person _UIA_setVar("oCustomer","Title:=Reported By:;controltype:=UIA_EditControlTypeId;class:=") ; Reported By Email _UIA_setVar("oEmail","Title:=Reported By Email:;controltype:=UIA_EditControlTypeId;class:=") ; Reported By Phone _UIA_setVar("oPhone","Title:=Reported By Phone:;controltype:=UIA_EditControlTypeId;class:=") Local $WorkType = "CM" ; Send the stored data to the proper field Local $stringSplitter = ", " Local $conCateStrings = $eDescription & $stringSplitter & $eComments Local $ComStringLen = StringLen($eComments) Local $TrimedDesc = StringTrimLeft($eDescription, 1) ;=============================================================================== ; Check to see if the Description and the Long Description can be concatenated If StringLen($conCateStrings) <= 100 Then Sleep(2000) _UIA_action("oDescription","highlight") Sleep(300) _UIA_Action("oDescription","setfocus") Sleep(300) _UIA_action("oDescription","click") Sleep(500) _UIA_action("oDescription", "setvalue", $conCateStrings) _UIA_action("oDescription","highlight") ; Wipes the long description so no duplication happens $eComments = "" ;=============================================================================== ; Send the Long Description in place of the Description ElseIf $TrimedDesc = "Other" AND $ComStringLen <= 100 Then Sleep(2000) _UIA_action("oDescription","highlight") Sleep(300) _UIA_Action("oDescription","setfocus") Sleep(300) _UIA_action("oDescription","click") Sleep(500) _UIA_action("oDescription", "setvalue", $eComments) _UIA_action("oDescription","highlight") Sleep(2000) ;=============================================================================== ; Send the Long Description in place of the Description and Send the rest of it to the Long Description field ElseIf $TrimedDesc = "Other" AND $ComStringLen >= 100 Then SplitLongDesc() ; Description gets the first 100 Characters $eDescription = $FirstLine ; Long Description gets the rest $eComments = StringMid($sNewString, 101) Sleep(2000) _UIA_action("oDescription","highlight") Sleep(500) _UIA_Action("oDescription","setfocus") Sleep(500) _UIA_action("oDescription","click") Sleep(500) _UIA_action("oDescription", "setvalue", $eDescription) _UIA_action("oDescription","highlight") Sleep(2000) ;=============================================================================== ; Send the Description and some of the Long Description ElseIf StringLen($eDescription) <= 80 AND $eComments <> "" Then SplitLongDesc() ; Description gets the first 100 Characters $eDescription = $FirstLine ; Long Description gets the rest $eComments = StringMid($sNewString, 101) Sleep(2000) _UIA_action("oDescription","highlight") Sleep(300) _UIA_Action("oDescription","setfocus") Sleep(300) _UIA_action("oDescription","click") Sleep(500) _UIA_action("oDescription", "setvalue", $eDescription) _UIA_action("oDescription","highlight") Sleep(2000) ;=============================================================================== ; Send the original Description Else Sleep(2000) _UIA_action("oDescription","highlight") Sleep(300) _UIA_Action("oDescription","setfocus") Sleep(300) _UIA_action("oDescription","click") Sleep(500) _UIA_action("oDescription", "setvalue", $eDescription) _UIA_action("oDescription","highlight") Sleep(2000) EndIf ;=============================================================================== ; Click the long description button Sleep(2000) _UIA_action("oLongButton","highlight") Sleep(300) _UIA_Action("oLongButton","setfocus") Sleep(300) _UIA_action("oLongButton", "click") _UIA_action("oLongButton", "highlight") _UIA_action("oLongButton", "click") Sleep(2000) ;=============================================================================== ; Send the long description Sleep(1000) if StringLen($eComments) >= 250 Then Sleep(500) Send($eComments) Sleep(10000) ElseIf StringLen($eComments) >= 150 Then Sleep(500) Send($eComments) Sleep(6000) ElseIf StringLen($eComments) <= 10 Then Sleep(500) Send($eComments) Sleep(1500) Else Sleep(500) Send($eComments) Sleep(4000) EndIf ;=============================================================================== ; Click the ok button Sleep(2000) _UIA_action("oLongOk","highlight") Sleep(300) _UIA_Action("oLongOk","setfocus") Sleep(300) _UIA_action("oLongOk", "click") _UIA_action("oLongOk", "highlight") Sleep(2000) ;=============================================================================== ; The work order number _UIA_action("oWorkOrderNum","highlight") Sleep(300) _UIA_Action("oWorkOrderNum","setfocus") Sleep(300) _UIA_action("oWorkOrderNum", "getvalue", $WoNum) _UIA_action("oWorkOrderNum","highlight") ;MsgBox("", "Work order number", $WoNum[2]) ;=============================================================================== ; The Location field Sleep(2000) _UIA_action("oLocation","highlight") Sleep(300) _UIA_Action("oLocation","setfocus") Sleep(300) _UIA_action("oLocation", "setvalue", $eLocation) _UIA_action("oLocation","highlight") ;=============================================================================== ; The Work Type field Sleep(2000) _UIA_action("oWorkType","highlight") Sleep(300) _UIA_Action("oWorkType","setfocus") Sleep(300) _UIA_action("oWorkType", "setvalue", $WorkType) _UIA_action("oWorkType","highlight") ;=============================================================================== ; The Reported By Date Sleep(2000) _UIA_action("oDate","highlight") Sleep(300) _UIA_Action("oDate","setfocus") Sleep(300) _UIA_action("oDate", "setvalue", $eSentOn) _UIA_action("oDate","highlight") ;=============================================================================== ; The Requested by field Sleep(2000) _UIA_action("oCustomer","highlight") Sleep(300) _UIA_Action("oCustomer","setfocus") Sleep(300) _UIA_action("oCustomer", "setvalue", $eReportedBy) _UIA_action("oCustomer","highlight") ;=============================================================================== ; The Requested by E-mail Sleep(2000) _UIA_action("oEmail","highlight") Sleep(300) _UIA_Action("oEmail","setfocus") Sleep(300) _UIA_action("oEmail", "setvalue", $eSenderAddress) _UIA_action("oEmail","highlight") ;=============================================================================== ; The Requested by Phone Sleep(2000) _UIA_action("oPhone","highlight") Sleep(300) _UIA_Action("oPhone","setfocus") Sleep(300) _UIA_action("oPhone", "setvalue", $eRoomPhone) _UIA_action("oPhone","highlight") MouseClick("left", 1843, 437, 2) Sleep(1500) Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Send("{UP}") Sleep(1000) MouseClick("left", 591, 279, 2) Sleep(3000) $lCount += 1 ConsoleWrite("Action 16: Finished" & " at line: " & @ScriptLineNumber & @CRLF) Sleep(2000) EndFunc  
      That is not all the code but that is the function that keeps "breaking" and by "breaking" I mean the program acts like it doesn't know where the description field is after the first iteration.
      My code will just click somewhere in the far top left corner and somehow shrink the browser in the process of finding the description field.  
       
      The code works perfectly the first iteration but after that, it "breaks" (doesn't know where to click/send data to). 
      As always any help is greatly appreciated. 
       
      NOTE: By the time 'Action 16' runs Chrome has already been opened and has navigated to the proper webpage.  I am trying to loop 'Action 16' multiple times. I do not leave that webpage while looping. 
    • By nooneclose
      Good morning, I am having a hard time figuring out how to read or get the valve (628850) from the red squared box in the picture below. 

      Here is what I have tried so far. (see code below. Also, I'm very sorry my code is sloppy.)
       
      #AutoIt3Wrapper_Au3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 ;Allows for the combining of UDFs by disabling error messages. (I get error messages for "problems" that dont actually exsist) #include <AD.au3> ;Allows Active Directory functions #include <Array.au3> ;Allows special Array functions #include <Constants.au3> ;Allows constants to be used #include <Date.au3> ;Allows Date and Time functions #include <DateTimeConstants.au3> ;Allows Date and Time constant functions #include "DTC.au3" ;Allows Custom Date and Time functions #include <IE.au3> ;Allows Internet Explorer functions #include <Misc.au3> ;Allows the "is pressed" function to be used #include <MsgBoxConstants.au3> ;Allows Message box function to be used #include <OutlookEX.au3> ;Allows the Outlook functions #include <String.au3> ;Allows special string functions #include <StringConstants.au3> ;Allows String constant functions #include <Timers.au3> ;Allows timer functions ;#RequireAdmin ;Requests admin privliges before starting program #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <debug.au3> #include <WinAPI.au3> #include "UIAWrappers.au3" #AutoIt3Wrapper_UseX64=N ;Should be used for stuff like tagpoint having right struct etc. when running on a 64 bits os ; Sets the script to accept coordinates off the program window and not the screen AutoItSetOption('MouseCoordMode', 0) ; Defines the time it takes to send text to the software/program AutoItSetOption('SendKeyDelay', 10) ;******************************************************************************* ; Close the script if "End" is pressed ;******************************************************************************* Local $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") HotKeySet("{END}", "Terminate") Func Terminate() MsgBox($MB_ICONINFORMATION, "DEATH", "AI Stoped!", 5) Exit EndFunc ;******************************************************************************* ; Script has started ;******************************************************************************* Sleep(2000) MsgBox($MB_ICONINFORMATION, "WO_AI", "AI Started!", 5) Sleep(1500) ;******************************************************************************* ; Main functions of the program ;******************************************************************************* test() ;=============================================================================== ; Function Definitions ;=============================================================================== Func test() MsgBox("", "TESTing", "Timer Started") Sleep(15000) MsgBox("", "TESTing", "timer Finished") ;~ *** Standard code maintainable *** AutoItSetOption("MustDeclareVars", 1) _UIA_setVar("oP1","Title:=Work Order Tracking - Google Chrome;controltype:=UIA_PaneControlTypeId;class:=Chrome_WidgetWin_1") ;Work Order Tracking - Google Chrome _UIA_setVar("oP2","Title:=Work Order Tracking;controltype:=UIA_DocumentControlTypeId;class:=Chrome_RenderWidgetHostHWND") ;Work Order Tracking _UIA_setVar("oP3","Title:=  Work Order Tracking;controltype:=UIA_CustomControlTypeId;class:=") ;  Work Order Tracking _UIA_setVar("oP4","Title:=main form;controltype:=UIA_GroupControlTypeId;class:=") ;main form _UIA_setVar("oP5","Title:=;controltype:=UIA_CustomControlTypeId;class:=") ; _UIA_setVar("oP6","Title:=View Work Details;controltype:=UIA_CustomControlTypeId;class:=") ;View Work Details _UIA_setVar("oP7","Title:=;controltype:=UIA_CustomControlTypeId;class:=") ; _UIA_setVar("oP8","Title:=Location: Location description Long Description Include Children? Include Children: unchecked Include Ancestors? Include Ancestors: unchecked Include History? Include History: unchecked Work Scope Minimize Work Scope Section Minimize Work Scope Section Work Scope Work Close Filter CTRL+Z Close Filter CTRL+Z Filter Filter Table Filter Table Next Row [CTRL+Down Arrow] Next Row [CTRL+Down Arrow] 1 - 4 of 4 Download Hide Table: Work Hide Table: Work Work Work Table Button Group;controltype:=UIA_CustomControlTypeId;class:=") ;Location: Location description Long Description Include Children? Include Children: unchecked Include Ancestors? Include Ancestors: unchecked Include History? Include History: unchecked Work Scope Minimize Work Scope Section Minimize Work Scope Section Work Scope Work Close Filter CTRL+Z Close Filter CTRL+Z Filter Filter Table Filter Table Next Row [CTRL+Down Arrow] Next Row [CTRL+Down Arrow] 1 - 4 of 4 Download Hide Table: Work Hide Table: Work Work Work Table Button Group _UIA_setVar("oP9","Title:=;controltype:=UIA_CustomControlTypeId;class:=") ; _UIA_setVar("oP10","Title:=Work;controltype:=UIA_TableControlTypeId;class:=") ;Work _UIA_setVar("oP11","Title:=;controltype:=UIA_CustomControlTypeId;class:=") ; _UIA_setVar("oP12","Title:=Record Detail Menu;controltype:=UIA_DataItemControlTypeId;class:=") ;Record Detail Menu ; Clicks on the main record field _UIA_setVar("oUIElement","Title:=Record ;controltype:=UIA_EditControlTypeId;class:=") ;ControlType:=UIA_EditControlTypeId;classname:=") ; Trying to click on / get value from the 3rd from top record field (this is me trying to use the id to access the record box) Local $otest =_UIA_getObjectByFindAll("Record.mainwindow", "id:=ma9038468_tdrow_[C\:1]_txt-tb[R\:3].;ControlType:=UIA_DataItemControlTypeId", $treescope_subtree) ;~ Actions split away from logical/technical definition above can come from configfiles ;~_UIA_Action("oP1","highlight") _UIA_Action("oP1","setfocus") ;~_UIA_Action("oP2","highlight") _UIA_Action("oP2","setfocus") ;~_UIA_Action("oP3","highlight") _UIA_Action("oP3","setfocus") ;~_UIA_Action("oP4","highlight") _UIA_Action("oP4","setfocus") ;~_UIA_Action("oP5","highlight") _UIA_Action("oP5","setfocus") ;~_UIA_Action("oP6","highlight") _UIA_Action("oP6","setfocus") ;~_UIA_Action("oP7","highlight") _UIA_Action("oP7","setfocus") ;~_UIA_Action("oP8","highlight") _UIA_Action("oP8","setfocus") ;~_UIA_Action("oP9","highlight") _UIA_Action("oP9","setfocus") ;~_UIA_Action("oP10","highlight") _UIA_Action("oP10","setfocus") ;~_UIA_Action("oP11","highlight") _UIA_Action("oP11","setfocus") ;~_UIA_Action("oP12","highlight") _UIA_Action("oP12","setfocus") _UIA_action("oUIElement","highlight") _UIA_Action("oUIElement","setfocus") _UIA_action("oUIElement","click") Sleep(2500) _UIA_action($otest,"highlight") _UIA_Action($otest,"setfocus") _UIA_action($otest,"click") MsgBox("", "End of program", "death") EndFunc I'm using $otest to try and click on the box, through the id that chrome gives it, with the UIA functions. I am kind of completely new to the UIA UDF but I do find it capable of doing a lot of cool things.   
      as always any help would be greatly appreciated. I know how hard you people hard. Thank you for taking the time to help us. 
    • By UGH
      Autoit team are assbags.    They want to hold out that they are soooo much smarter than everyone else and they really don't want to help anyone with their questions.   In that case then why have a website.   Oh i know, they get their kicks out of laughing at everyone. 
       
       
       
       
       
       
       
    • By nooneclose
      I want to check some Excel data against data on a website in Chrome. I use Chrome because the site I use does not function properly in Internet Explorer or Firefox. I know how to do the Excel stuff I just can not figure out how to send to Chrome, let alone check to see if the data matches or not. I am also having trouble finding any help online while searching for Chrome functions for Autoit. I have a Chrome UDF installed but I still can not figure out how to get my code to properly function. (I am not posting code because I am  sure my code isn't right, to begin with)
      As usual, any and all help would be greatly appreciated. 
    • By stafe
      Hello
      I am trying to get chrome to save it's current webpage to a pdf using autoit.  I wold like to save the file into a folder on the desktop called "ChromeFiles" .  However when I use the send command chrome only occasionally responds.
      Thank you
      Simon
       
×
×
  • Create New...