Jump to content

ControlSetText value is ignored in Save As


Recommended Posts

Hello everybody. I'm trying to save PDF file from IE11 (Adobe Reader  plugin). I'm using:

ControlSetText("Save As", "", "Edit1", $CmdLine[2])

where CmdLine[2] is absolute path to save the PDF. Default name of file is Alerts.pdf, and I want to rename it and save into specific path. Problem is that this path is just ignored, even though it was inserted. See the screenshot. Any idea?

Thank you in advance!

 

ait.JPG

Link to comment
Share on other sites

Of course man! Where's my manners? :)

WinWait($CmdLine[1],"",20)
ControlFocus($CmdLine[1],"","AVL_AVView15")
Send("+^{S}")
Sleep(4000)
WinWait("Adobe Reader","",20)
ControlClick("Adobe Reader", "","Button2")
WinWait("Save As","",10)
Sleep(4000)
ControlSetText("Save As", "", "Edit1", $CmdLine[2])
Sleep(4000)
ControlClick("Save As", "","Button1")
WinWait($CmdLine[1],"",10)
Send("!{F4}")

The CmdLine[2] is just string representing path of file to be saved.

I personally solved the issue by just replacing:

ControlSetText("Save As", "", "Edit1", $CmdLine[2])

with:

Send($CmdLine[2])

But who knows, perhaps you have more elegant solution for this problem.

 

Cheers!

Link to comment
Share on other sites

I was playing around a bit and was only able to get controlsettext to work if I than sent, and deleted, a space.  This is still much more reliable than sending the full string at least. 

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...