BSBAL18 Posted December 8, 2011 Posted December 8, 2011 I have one question that is basic that i cannot seem to find ANYWHERE around the forum. If i have an existing GUI (say some normal application is running). I can get information on the GUI, move it, resize it, etc etc. However, the one thing i am trying to do is to read the GUI's textbox/buttonText/combo box details. How would I go about doing this? Basically just gathering information from WITHIN the GUI itself, beyond the amatuer 'GetWinText' and other 'Get's. My main concern is reading a ever-changing combobox and being able to 'check' the items i want, which can appear in random order. ANy direction would be appreciated, even if its just 'look at the topic <x> in the help file'.
water Posted December 8, 2011 Posted December 8, 2011 (edited) Welcome to AutoIt and the forum! Please have a look a the "ControlCommand" function. Edited December 8, 2011 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
BSBAL18 Posted December 8, 2011 Author Posted December 8, 2011 i use the below... curTitle = .WinGetTitle("[active]") curTxt = .WinGetText("[active]") testControl = .ControlGetText(curTitle, curTxt, "717") i used winInfo to get the ID, and its just a textbox on the GUI... but the @error always kicks (doesnt tell me anything) and the TextControl var returns a "" (which from doc means it errored). Nothing seems to be working. The curTitle and curTxt works when i watch the vars... but after that, it doesnt return anything.... Thoughts?
water Posted December 8, 2011 Posted December 8, 2011 Could you please post the real code you use? The code you posted will raise syntax errors and therefore never run. A screenshot of the GUI you want to automate would be fine too. 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
BSBAL18 Posted December 9, 2011 Author Posted December 9, 2011 Public Sub ProcessEntries() Dim oAutoIt As New AutoItX3 Dim curText As String Dim curTitle As String Dim curData As String oAutoIt.Sleep 4000 'This works just fine curTitle = oAutoIt.WinGetTitle("[active]") curText = oAutoIt.WinGetText("[active]") 'This doesnt work at all (either using the ID in a string, or as a nonString curData = oAutoIt.ControlGetText(curTitle, curText, "93697896") err = oAutoIt.Error 'In the above test.... ' curData returns "" ' Err returns... 1 ' Description: "" ' HelpContext: 0 ' HelpFile: "" ' LastDllError: 0 ' Number: 1 ' Source: "" Stop 'used for watching the vars End Sub
water Posted December 9, 2011 Posted December 9, 2011 You seem to use AutoItObject. Is this intended? 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
BSBAL18 Posted December 9, 2011 Author Posted December 9, 2011 Yes, i use it through Microsoft Office Excel VBA programming because i use Excel as a data reference to easily loop through and populate the cells with data as the automation is running.
water Posted December 9, 2011 Posted December 9, 2011 Unfortunately I can't help you with this. But maybe you get some answer on the 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