Jump to content
Sign in to follow this  
Diana (Cda)

[Resolved] "Send" has some trouble with certain characters that "ClipPut" doesn't?

Recommended Posts

Diana (Cda)

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 by Diana (Cda)

Share this post


Link to post
Share on other sites
Josbe

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)

Share this post


Link to post
Share on other sites
Malkey

This could be a "work around".

$code = "AGFiMgo+2-vGk example only"
Send(StringRegExpReplace($code, "([!#+^{}])", "{\1}") & "{ENTER}")

Share this post


Link to post
Share on other sites
Diana (Cda)

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!

Share this post


Link to post
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
Sign in to follow this  

×