Sign in to follow this  
Followers 0
sl_alagappan

How to send text to a specific window ?

8 posts in this topic

I hv an application whereby there are some controls for which I am not able to send the required text using AutoitX/VB.

So, I would like to send the text to the required window using window title/text.

Can I send any text to any required window with specific window title/text.

send() is not useful for this purpose.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

ControlSend ( "title", "text", controlID, "string" [, flag] )

eg.

ControlSend("Untitled", "", "Edit1", "This is a line of text in the notepad window")

From the help file. Use the AutoIt Window Info Tool to get the controlID.

Edited by Burrup

[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

ControlSend ( "title", "text", controlID, "string" [, flag] )

eg.

ControlSend("Untitled", "", "Edit1", "This is a line of text in the notepad window")

From the help file. Use the AutoIt Window Info Tool to get the controlID.

<{POST_SNAPBACK}>

The control ID does not work. The application has a grid whereby a single text box is used to get input from all required input.

So, I need to send text to the required window withou mentioning the control id.

Share this post


Link to post
Share on other sites

I suppose you could just give focus to the window and send it.

WinActivate ( "title")
Send("test")

[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

I suppose you could just give focus to the window and send it.

WinActivate ( "title")
Send("test")

<{POST_SNAPBACK}>

While appreciating your efforts to answer my prob, pl note that the send command is not useful at this application since I need to send to the exact required window.

By the time, send command sends, any other window could become active window.

Fyi, I hv been asking for such facility for a long time ( to send any text to the required window title/text without specifying any control name.

I believe, the experts at AutoIt Developer forum will find some time and way to resolve this.

Regards

Share this post


Link to post
Share on other sites

While appreciating your efforts to answer my prob, pl note that the send command is not useful at this application since I need to send to the exact required window.

By the time, send command sends, any other window could become active window.

Fyi, I hv been asking for such facility for a long time ( to send any text to the required window title/text without specifying any control name.

I believe, the experts at AutoIt Developer forum will find some time and way to resolve this.

Regards

<{POST_SNAPBACK}>

We do our best (at least I think) but ControlSend is and improvement that other scripting language don't have. It need some more information that's the reason of the ControlID necessity :)

Share this post


Link to post
Share on other sites

some control should be reference so controlID is a necessity. AutoIt cannot decide which one.

Use send for this purpose

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