Jump to content

Autoit Send sometimes convert : to ; (colon to semi colon) and \ to | (backslash to pipe)


Recommended Posts

Posted

I have an autoit script that uses the Send function to send keyboard typing to input boxes.

In particular, it is sending file name paths to a "Save File" dialog box in windows (printing a PDF file).

So the command is something like:

$filename = "C:\BLX\print\output.pdf"

Send($filename)

 

This seems to work most of the time.  However, sometimes, the keys that are sent are actually converted:

:   becomes  ;

\ becomes |

 

You can see this in the error message below.  I'm 100% sure my $filename variable does NOT contain the ; or | characters.  I've even done:

StringReplace($filename, ";", ":")

StringReplace($filename, "|", "\")

just before the call to:

Send($filename).

 

The problem is somewhat intermittent.  Does anyone have any suggestions or ideas as to how to fix this?

 

Thanks

Alex.

 

image.png.dc99f256cdb8eefd4925c0d026b7a99a.png

Posted (edited)

Welcome to AutoIt and the forum!

Please try

#include <AutoItConstants.au3>
Global $filename = "C:\BLX\print\output.pdf"
Send($filename, $SEND_RAW)

 

Edited by water

My UDFs and Tutorials:

  Reveal hidden contents

 

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