Guest mlukhman Posted September 9, 2005 Posted September 9, 2005 I'm currently writing scripts to perform installs but we want these programs to be located within c:\program files folder hierachy. Some of the installer I have place the application elsewhere so have to change the folder location accordingly. With AutoIt I use a combination ; Please choose the installation folder $TITLE="Choose Folder" $TEXT="Edit" if WinExists($TITLE, $TEXT) Then WinActivate($TITLE, $TEXT) ControlSend($TITLE, $TEXT, "Edit1", $LOCATION) ControlClick($TITLE, $TEXT, 4, "Edit1") EndIf or ; Please choose the installation folder $TITLE="Choose Folder" $TEXT="Edit" if WinExists($TITLE, $TEXT) Then WinActivate($TITLE, $TEXT) Send($LOCATION) ControlClick($TITLE, $TEXT, 4, "Edit1") EndIf These work but I've now come to an installer where Send() or ControlSend() don't seem to being acted upon (i.e. the folder location is being left unchanged). Haven't a clue as who do deal with this problem. Any suggestions?
Valuater Posted September 9, 2005 Posted September 9, 2005 (edited) for the folder only use this $var = FileSelectFolder("Choose a folder.", "") or maybe this for folder and file name $var = FileSaveDialog( "Choose a name.", $MyDocsFolder, "Scripts (*.aut;*.au3)", 3) ; option 3 = dialog remains until valid path/file selected If @error Then MsgBox(4096,"","Save cancelled.") Else MsgBox(4096,"","You chose " & $var) EndIf you can see these in help also @ProgramFilesDir & "\" shows the program files folder 8) Edited September 9, 2005 by Valuater
MHz Posted September 9, 2005 Posted September 9, 2005 Does Au3Info tool report the control "Edit1" as hidden? Is a browse button available?WinExists() is not a waiting function, so it could execute before the window appears. WinWait maybe more suitable?Your ControlClick() functions are incorrect. "Edit1" is not button to click.[optional]The button to click, "left", "right" or "middle". Default is the left button.
GaryFrost Posted September 9, 2005 Posted September 9, 2005 (edited) may not be a standard edit box or may not be edit1, try the autoit window info tool on that screen and see what the control info is. Edited September 9, 2005 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
Guest mlukhman Posted September 9, 2005 Posted September 9, 2005 Your ControlClick() functions are incorrect. "Edit1" is not button to click.<{POST_SNAPBACK}>Your right. Spotted that mistake just now, and it's now working fine.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now