Sign in to follow this  
Followers 0
Ssam

WinGetText issue

8 posts in this topic

What I am attempting to do is , read text in a richtext window from a window not created by autoit . Am I correct in the assumption that WinGetText would be the way to do this ?

$var = WinGetText("[CLASS:RichTextWndClass; INSTANCE:9]", "1")

MsgBox(0, "Text read was:", $var)

Thank you in advance for your help with this .

Share this post


Link to post
Share on other sites



Might try ControlGetText(), the RichEdit is a child of the main window regardless of what application created it.

If that doesn't work, then take a look at some of the _GUICtrlEdit_* functions, the UDF ones can work on other applications as well if you can get the handle of the control (with ControlGetHandle presumably )


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

I think you'll need ControlGetText because [CLASS:RichTextWndClass; INSTANCE:9] is a control-Id.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Thank you I will try that and see if I have any better luck.

Edited by Ssam

Share this post


Link to post
Share on other sites

I am not having a whole lot of luck . Perhaps if i explain what i am trying to do it may help you all to point me in the right direction.

What my intention is to take a single character of text from a rich text window and then depending on the character have autoit press one of four buttons that are located on the same window . I have tried both WinGetText and ControlGetText but have not been able to get either to work for me.

One that looks promising is _GUICtrlEdit_GetText($hWnd) but i am having the error of undefined function when i try to use this .

Share this post


Link to post
Share on other sites

Could you please run AutoIt Window Info, point to the control and take screenshots of the Window and Control Tab? A screenshot of the application you want to get the text from could be helpful as well.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Hope i managed to get the info you need to be able to help

Both Pics you asked for

What i am trying to do is write something that looks at the data in the answer "E" text box and then from there makes a single leftmouseclik on either Button A B C or D depending on the Data in the "E" text box . Once i get to that point i am then looking to have it delete the data the textbox for "E" then press the first Right Arrow at the bottom of the page so that it moves to the next file . i think i can handle it once i finally get it to be able to read the text . but right now i am just frustrated with my own limited knowledge

once again thank you for your help

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Could you please try:

AutoItSetOption("WinTitleMatchMode",1)
$sText = ControlGetText("Random Test Generator","","[CLASS:RichTextWndClass; INSTANCE:9]")
msgbox(0,"","Text: " & $sText & @CRLF & "Error: " & @error)
Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

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