Jump to content

ControlSend replacing column with semicolumn

Recommended Posts


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)
Local $oUIElement=_UIA_getObjectByFindAll($oP1, "title:=\.\.\.;ControlType:=UIA_ButtonControlTypeId", $treescope_subtree)
$tPattern = _UIA_getPattern($oUIElement, $UIA_InvokePatternId)
;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.

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 on windows 7 x64

Share this post

Link to post
Share on other sites

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