Ssam Posted July 22, 2009 Posted July 22, 2009 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 .
Moderators SmOke_N Posted July 22, 2009 Moderators Posted July 22, 2009 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 ) 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.
water Posted July 22, 2009 Posted July 22, 2009 I think you'll need ControlGetText because [CLASS:RichTextWndClass; INSTANCE:9] is a control-Id. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Ssam Posted July 22, 2009 Author Posted July 22, 2009 (edited) Thank you I will try that and see if I have any better luck. Edited July 22, 2009 by Ssam
Ssam Posted July 22, 2009 Author Posted July 22, 2009 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 .
water Posted July 23, 2009 Posted July 23, 2009 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 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Ssam Posted July 23, 2009 Author Posted July 23, 2009 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 knowledgeonce again thank you for your help
water Posted July 24, 2009 Posted July 24, 2009 (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 July 24, 2009 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now