WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: mjwillyone on May 24, 2018, 08:08:08 AM

Title: sendkeysto - long file location and file
Post by: mjwillyone on May 24, 2018, 08:08:08 AM
Hello,

I am using Winbatch 2013C.  When I attempt to use the SendKeysTo command to save a new PDF file to a directory on my computer, I get an error. 

The problem is that as the file location and then the name are "typed" across the "Save As" box, the first characters of the location get dropped off.  Since there is no folder on my computer by this name, an error occurs (see attached image.)

Any idea what I can do to get the entire file location AND new file name to appear in the "Save As" box?

Thank you so much!
Mike
Title: Re: sendkeysto - long file location and file
Post by: td on May 24, 2018, 10:36:55 AM
Can't say that I can reproduce your problem with the latest version of WinBatch running on the latest version of Windows but I do recall it coming up before.  The "Save As" dialog is actually a Windows Explorer shell dialog hosted and owned by the Adobe process and main window.  Assuming the input focus is on the dialog's edit box your problem is likely due to some background message processing being conducted by the window.   

You could try delaying the attempt to send keys to the dialog but that is not likely to always be a repeatable solution or you could try using SendKeysTo with past keystrokes to paste the file path into the edit box.  Firing up Roboscripter and creating a Control Manager Extender abased script is another option and may be more successful.

You may also want to read the following post:

http://forum.winbatch.com/index.php?topic=2030.0 (http://forum.winbatch.com/index.php?topic=2030.0)
Title: Re: sendkeysto - long file location and file
Post by: gibberish on May 28, 2018, 08:17:25 AM
I would second TD's suggestion to use the RoboScripter tool in the WinBatch System folder to create a Control-Manager script that will ensure you are sending the data to the correct input field.

It is possible you are not actually sending those keystrokes into the input field until the right character is sent in the path string that jumps the focus into the input field and then the remainder of the characters appear where you want them.

If you need help using Roboscripter, please ask - but there are many examples in the Tech DB.