dvader

ControlSend replacing column with semicolumn

2 posts in this topic

#1 ·  Posted

When I send a path to an edit box using ControlSend, the column is sometimes replaced by a semicolumn making the script fail. It doesn't happen all the time, just more often recently. I have to use ControlSend instead of Send as the machine I am controlling is locked (running an unattended automated build).

Here's a copy of the section of the script:

Local $oP2=_UIA_getObjectByFindAll($UIA_oDesktop, "controltype:=UIA_WindowControlTypeId;class:=AfxMDIFrame90u", $treescope_children)
Local $oP1=_UIA_getObjectByFindAll($oP2, "Title:=Update Package;controltype:=UIA_WindowControlTypeId;class:=QWidget", $treescope_children)
_UIA_DumpThemAll($oP1,$treescope_subtree)
Local $oUIElement=_UIA_getObjectByFindAll($oP1, "title:=\.\.\.;ControlType:=UIA_ButtonControlTypeId", $treescope_subtree)
$tPattern = _UIA_getPattern($oUIElement, $UIA_InvokePatternId)
$tPattern.invoke()
;ce File path selection
;ce Testing

; For some reason, the file dialog box does not appear until later and the WinWait still goes through even though the window is not visible so we wait 5s. Bad as there is no feedback but that is working at the moment.
Sleep(5000)

WinWait("Choose a folder to open", "", 10)

ControlSend("Choose a folder to open", "", "Edit1", $CmdLine[2])
ControlClick("Choose a folder to open", "", "Select Folder")

The problem is on line: ControlSend("Choose a folder to open", "", "Edit1", $CmdLine[2])

I have read other posts regarding the issue but I haven't found any solution so far.

I am using AutoIt 3.3.14.2 on windows 7 x64

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Can you test $CmdLine[2] for a semicolon and if it's there replace it with a colon?

Does ControlSetText have the same problem?

Edited by gruntydatsun
added another option

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