Jump to content

Recommended Posts

Posted (edited)

Hi,

With the following script I'm trying to click in a textbox so that after the script is through running it is ready for typing.

Why want the cursor display in the textbox so that typing can be performed?

$oInputs = _IETagNameGetCollection ($oIE, "input")
    $iInputsCnt = @extended ;Form Tag Total Count & must be directly below tag name for correct total count 
    
    $inputTexbox = "mainForm:RAPID_TIMECARD_EDIT_content:workOrderZoom:ae_p_pro_e_proposal"
    
    For $oInput In $oInputs
        ;MsgBox(0, "Form Input Type", "Form: " & $oInput.form.name & " Type: " & $oInput.type)
        If $oInput.id = $inputTexbox Then $oinputTexbox = $oInput
;~      ConsoleWrite("Form Input Type " & @TAB & "Form Name: " & $oInput.form.name & @TAB & " Type: " & $oInput.type & _
;~          " ID: " & $oInput.id & @TAB & " Name: " & $oInput.Name & @LF)   
    Next
    
;~  MouseClick("left", 675, 279)
    _IEAction($oinputTexbox, "click")

Thank you for your help,

jfcby

Edited by jfcby

Determined -- Devoted -- Delivered Make your mind up -- to seriously apply yourself -- accomplishing the desired results. **** A soft answer turneth away wrath: but grievous words stir up anger. Proverbs 15:1 KJB ****

Posted

Hi,

With the following script I'm trying to click in a textbox so that after the script is through running it is ready for typing.

Why want the cursor display in the textbox so that typing can be performed?

$oInputs = _IETagNameGetCollection ($oIE, "input")
    $iInputsCnt = @extended ;Form Tag Total Count & must be directly below tag name for correct total count 
    
    $inputTexbox = "mainForm:RAPID_TIMECARD_EDIT_content:workOrderZoom:ae_p_pro_e_proposal"
    
    For $oInput In $oInputs
        ;MsgBox(0, "Form Input Type", "Form: " & $oInput.form.name & " Type: " & $oInput.type)
        If $oInput.id = $inputTexbox Then $oinputTexbox = $oInput
;~      ConsoleWrite("Form Input Type " & @TAB & "Form Name: " & $oInput.form.name & @TAB & " Type: " & $oInput.type & _
;~          " ID: " & $oInput.id & @TAB & " Name: " & $oInput.Name & @LF)   
    Next
    
;~  MouseClick("left", 675, 279)
    _IEAction($oinputTexbox, "click")

Thank you for your help,

jfcby

_IEAction() with "click" only sends a message to the element, it doesn't move the mouse the way Mouseclick() would. Try _IEAction() with "focus" instead.

If you do need to MouseClick() an IE element, you can get its coordinates using _IEPropertyGet() with "browserX" and "browserY".

:)

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

_IEAction() with "click" only sends a message to the element, it doesn't move the mouse the way Mouseclick() would. Try _IEAction() with "focus" instead.

If you do need to MouseClick() an IE element, you can get its coordinates using _IEPropertyGet() with "browserX" and "browserY".

:)

PsaltyDS,

Your adviced worked with the script modified this way.

; ****************************************************************************************************************
    ; _IEFormGetObjByName, _IEFormElementGetObjByName, _IEFormElementSetValue, _IEAction
    ;   Put the cursor in a specificed input textbox so that it is ready for typing after script process is complete.
    ; ****************************************************************************************************************
    ;
    $oForm = _IEFormGetObjByName($oIE, "mainForm")
    $oText[4] = _IEFormElementGetObjByName($oForm, "mainForm:RAPID_TIMECARD_EDIT_content:workOrderZoom:ae_p_pro_e_proposal")
    _IEFormElementSetValue ($oText[4], "")
    _IEAction($oText[4], "focus")

Thank you for your help,

jfcby

Edited by jfcby

Determined -- Devoted -- Delivered Make your mind up -- to seriously apply yourself -- accomplishing the desired results. **** A soft answer turneth away wrath: but grievous words stir up anger. Proverbs 15:1 KJB ****

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
  • Recently Browsing   0 members

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