Jump to content
PeterKonc

ControlSetText value is ignored in Save As

Recommended Posts

PeterKonc

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

Share this post


Link to post
Share on other sites
Earthshine

print out your code so it can be reviewed. don't keep us guessing from screenshots that provide little to no relevant data. put in a msgbox of what CmdLine[2] computes to before calling the function with the bug.

  • Like 1

My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
PeterKonc

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!

  • Like 1

Share this post


Link to post
Share on other sites
Zedna

Try to use some shorter/more simple path for testing purpose. Maybe your very long path is too much and it's not accepted by Save dialog.

Also check existence of whole directory structure passed as path.

Share this post


Link to post
Share on other sites
jdelaney

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.

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

×