Sign in to follow this  
Followers 0
bafh

Controlsend problem - {"ENTER"}

6 posts in this topic

Hi Folks,

i got that problem that if i want to use the command Controlsend with Enter, it activates the window instead of sendin enter to the window! If the window is active (what i want to avoid) it works fine.

The problem is that i dont want the window to be active, any ideas?

Thanks alot!

Share this post


Link to post
Share on other sites



If you post some applicable code we can look at your problem


[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

Isn't it supposed to be "{ENTER}" instead of {"ENTER"}


[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

Yeah, its "{ENTER}" but anyway, just doesn't work!!!

Code is like

$window="Win1"

controlsend($window,"","","Hello")

sleep(1000)

controlsend($window,"","","{ENTER}")

AIght, it only works if I use Enter twice since the window get activated!!! The text works, just the Enter command doesnt!

Share this post


Link to post
Share on other sites

no one have ideas? i have the same problem

Share this post


Link to post
Share on other sites

no one have ideas? i have the same problem

You need to supply the ControlSend command more info (ie ControlID). Your first Enter is just activating the Application and the second is hitting the default button. You need the ControlID for the button you wish to hit. Use the AutoIT Window Info tool to find out the ControlID.


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

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