ayu_2403 Posted June 16, 2023 Posted June 16, 2023 Local $hWnd = WinWaitActive($SaveAsTitle, '&Save', 10) ControlClick($hWnd,"","ToolbarWindow324") ControlSetText($hWnd,"","Edit2",$sAddress) I want to open a save as dialog box navigate to a particular directory and then save the file. But these two commands ControlClick and Controlsettext does not seem to work. I have check control id many times. Please help.
Andreik Posted June 16, 2023 Posted June 16, 2023 Yeah sure, we are going to rub the crystal globe to determine about what address bar are you talking about. Provide at least a decent amount of information when you ask for help. Musashi 1
ayu_2403 Posted June 17, 2023 Author Posted June 17, 2023 10 hours ago, Andreik said: Yeah sure, we are going to rub the crystal globe to determine about what address bar are you talking about. Provide at least a decent amount of information when you ask for help. The toolbar in explorer where the address of current folder shows
ioa747 Posted June 17, 2023 Posted June 17, 2023 (edited) what kind of file do you want to save? with which program? ControlClick($hWnd,"","ToolbarWindow324") where the click is directed? Example for notepad $hDlgWnd = WinWait("[TITLE:Save As; CLASS:#32770]") ControlCommand($hDlgWnd, "", "ToolbarWindow324", "SendCommandID", 1280) ;set folder ControlSetText($hDlgWnd, "", "Edit2", @ScriptDir) ControlSend($hDlgWnd, "", "Edit2", "{ENTER}") Sleep(10) ;set file name ControlSetText($hDlgWnd, "", "Edit1", @ScriptName & ".txt") ControlSend($hDlgWnd, "", "Edit1", "{ENTER}") Sleep(10) ;save ControlClick($hDlgWnd, "", "Button2") ;exit ConsoleWrite("! exit" & @CRLF) Edited June 17, 2023 by ioa747 I know that I know nothing
ayu_2403 Posted June 17, 2023 Author Posted June 17, 2023 1 hour ago, ioa747 said: what kind of file do you want to save? with which program? ControlClick($hWnd,"","ToolbarWindow324") where the click is directed? Example for notepad $hDlgWnd = WinWait("[TITLE:Save As; CLASS:#32770]") ControlCommand($hDlgWnd, "", "ToolbarWindow324", "SendCommandID", 1280) ;set folder ControlSetText($hDlgWnd, "", "Edit2", @ScriptDir) ControlSend($hDlgWnd, "", "Edit2", "{ENTER}") Sleep(10) ;set file name ControlSetText($hDlgWnd, "", "Edit1", @ScriptName & ".txt") ControlSend($hDlgWnd, "", "Edit1", "{ENTER}") Sleep(10) ;save ControlClick($hDlgWnd, "", "Button2") ;exit ConsoleWrite("! exit" & @CRLF) Thanks, It worked one more thing, while saving the save button gets disabled. I think it is buffering, I want to check if it is enabled before clicking on it
ioa747 Posted June 17, 2023 Posted June 17, 2023 @ayu_2403 because you didn't mention what kind of file you want to save? with which program? I assume you are referring to my example with notepad Try to give more time to sleep e.g. Sleep(100) I know that I know nothing
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