Diana (Cda) Posted January 8, 2009 Posted January 8, 2009 (edited) I have a GUI that does 2 things to one data source in the script, one button sends the information to the KEYBOARD and a second sends the same information to the CLIPBOARD. I was wondering why I was having trouble with the first button as I kept getting errors until I compared the results side-by-side. CLIPPUT deals with them correctly while SEND makes a bit of a mess. I don't want to have to write 2 lines of code, one for SEND and one for CLIPPUT, since it's easier to have to define and keep track of just 1 variable, etc., etc. i.e., an example of type of thing which gives trouble is:$code = "AGFiMgo+2-vGk example only"AI's SEND changes that to AGFiMgo@-vGk example only", changing the +2 to @, almost as if + tells AI that it's to capitalize the next symbol. However, this has happened with another script with other symbols where the output of SEND was different from what was in the script's code. How can the issue be handled? Thanks. <g> Edited January 10, 2009 by Diana (Cda)
Achilles Posted January 8, 2009 Posted January 8, 2009 You need the helpfile for send... + means shift. {+} means a "+" will be printed. So, you want $code = "AGFimgo{+}2-vGX sjfls;d" My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
Josbe Posted January 8, 2009 Posted January 8, 2009 I have a GUI that does 2 things to one data source in the script, one button sends the information to the KEYBOARD and a second sends the same information to the CLIPBOARD. I was wondering why I was having trouble with the first button as I kept getting errors until I compared the results side-by-side. CLIPPUT deals with them correctly while SEND makes a bit of a mess. I don't want to have to write 2 lines of code, one for SEND and one for CLIPPUT, since it's easier to have to define and keep track of just 1 variable, etc., etc. i.e., an example of type of thing which gives trouble is:$code = "AGFiMgo+2-vGk example only"AI's SEND changes that to AGFiMgo@-vGk example only", changing the +2 to @, almost as if + tells AI that it's to capitalize the next symbol. However, this has happened with another script with other symbols where the output of SEND was different from what was in the script's code. How can the issue be handled? Thanks. <g>Take a look to Send() flags: Send(ClipGet(), 1) AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta
Malkey Posted January 8, 2009 Posted January 8, 2009 This could be a "work around". $code = "AGFiMgo+2-vGk example only" Send(StringRegExpReplace($code, "([!#+^{}])", "{\1}") & "{ENTER}")
Diana (Cda) Posted January 10, 2009 Author Posted January 10, 2009 This could be a "work around". $code = "AGFiMgo+2-vGk example only" Send(StringRegExpReplace($code, "([!#+^{}])", "{\1}") & "{ENTER}")You're brilliant! I was able to incorporate the string line above into the send function that I have. Since I had a {tab} code in there and it was also affected by this, I just separated the line into 2 sends so that I can re-use this code again just replacing the variables. And since the SEND regex replace above takes care of the symbols, that means that I am able to keep the one variable rather than writing 2, one for send and one for clipput. Thank you!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now