Jump to content

ControlSend mangles double quotes


rbabcock
 Share

Recommended Posts

I'm trying to automate a process that creates pdf files and sends them to a web server with ssh. Making the initial connection to the server takes 5 seconds and there are hundreds of files to be sent, so scp is painfully slow. Instead, I'm opening a second window running sftp and using autoit to send file transfer commands to that window. Send works fine for this until the user moves the windows around and changes the active window, so I'm trying ControlSend. But ControlSend seems to change double quotes to single quotes. For example, my script says

ControlSend($CmdLine[1], "", "", $CmdLine[2] & chr(13), 0)

I use start to open a cmd window with a known title and call my script with as""df as the 2nd argument. What gets sent to the target window is as'df. I've tried both the 3.1 release version and the 3.1.108 beta with the same result. Is there a way around this problem?

Link to comment
Share on other sites

  • 1 month later...

My script using ControlSendPlus seemed to be working well until the user got a new, faster computer running XP instead of Win/2K. Now he's seeing two errors: (1) a spurious single quote is sometimes appended to the message sent to the sftp window, and (2) for file names containing an underscore, the following character is sometimes in uppercase (but following characters are lower case). The target web server runs unix, so case is significant in the file names. I can't even reproduce the problem on my Win/2K workstation.

I just do

ControlSendPlus(window_title, "", "", text_to_send & chr(13), 0)

so it's really strange to see the shift-state problem. Are there any known problems with XP? Do I need to add a time delay when the shift state changes? Thanks for any suggestions.

Link to comment
Share on other sites

  • 1 month later...

My script using ControlSendPlus seemed to be working well until the user got a new, faster computer running XP instead of Win/2K.

The problem was not caused by the move to XP. Rather, the shift state changes sent by ControlSendPlus get out of sync with the keystrokes when a VNC connection is active watching the script run. The solution is don't do that.
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...