Diana (Cda) Posted January 8, 2009 Share 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) Link to comment Share on other sites More sharing options...
Achilles Posted January 8, 2009 Share 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] Link to comment Share on other sites More sharing options...
Josbe Posted January 8, 2009 Share 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 Link to comment Share on other sites More sharing options...
Malkey Posted January 8, 2009 Share Posted January 8, 2009 This could be a "work around". $code = "AGFiMgo+2-vGk example only" Send(StringRegExpReplace($code, "([!#+^{}])", "{\1}") & "{ENTER}") Link to comment Share on other sites More sharing options...
Diana (Cda) Posted January 10, 2009 Author Share 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! Link to comment Share on other sites More sharing options...
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