Jump to content

Recommended Posts

Posted
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.

Posted
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

image.png.7a79fbffa45895e727b6ca0702d67db6.png

Posted (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 by ioa747

I know that I know nothing

Posted
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

Posted

@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

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...