Sign in to follow this  
Followers 0
frew

How to Send a Send command as a string?

5 posts in this topic

Hello,

Send("{Right 4}")

works to send four right arrow keys, no problem.

But when I want to send this exact same string as a string Send("{Right 4}") I cannot get it to send.

I try this

Send("Send("{Right 4}")")

That's just wrapping the Send("{Right 4}") inside Send("") as usual for the other Send stuff I do.

...and I get unable to parse line error message.

Thanks for any ideas for me to try.

frew

Share this post


Link to post
Share on other sites



From the help file...

Send ( "keys" [, flag] )

Hmmm wonder what that flag thing might be about... looking at the next couple lines in the help file...

[optional] Changes how "keys" is processed:

flag = 0 (default), Text contains special characters like + and ! to indicate SHIFT and ALT key-presses.

flag = 1, keys are sent raw.

Ohh... that means

Send("{Right 4}",1)

Would probably do what you want :D


[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Share this post


Link to post
Share on other sites

Sorry, I didn't explain that well.

What I want is for the whole thing

Send("{Right 4}")

to be sent as a string.

So the script would type out this whole thing

Send("{Right 4}")

not just {Right 4} which your example does.

So I tried this

Send("Send("{Right 4}")")

which is just Send("{Right 4}") inside the usual Send("")

...and I get unable to parse line error message.

Thanks for any other ideas to try.

frew

Share this post


Link to post
Share on other sites

Send('Send("{Right 4}")',1)


[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Share this post


Link to post
Share on other sites

Thanks so much SpookMeister,

yes that's what i wanted to know.

I don't know about single quotes...I have to find out about that in the helpfile.

I hadn't heard of using single quotes there but I guess that's what makes it work, along with the 1 flag.

Thanks again,

Seeya,

frew

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  
Followers 0