bvr Posted July 19, 2006 Share Posted July 19, 2006 Say I want to search for certain words in a window, can autoit find letters or text like it does pixel colors? Link to comment Share on other sites More sharing options...
Paulie Posted July 19, 2006 Share Posted July 19, 2006 Say I want to search for certain words in a window, can autoit find letters or text like it does pixel colors?not quite... the only thing that i know of that is capable of doing something like that is "WinGetText()" but that just tells you if the text exists(and doesn't always work) not were it is Link to comment Share on other sites More sharing options...
bvr Posted July 19, 2006 Author Share Posted July 19, 2006 Can you explain what Insolence's script does, I don't quite understand it, and thats why I thought autoit could read text.http://www.autoitscript.com/forum/index.ph...c=8442&st=0 Link to comment Share on other sites More sharing options...
Paulie Posted July 19, 2006 Share Posted July 19, 2006 Can you explain what Insolence's script does, I don't quite understand it, and thats why I thought autoit could read text.http://www.autoitscript.com/forum/index.ph...c=8442&st=0This script is an OCR(Optical Character Recongnizer)it basically pixelschecks for a chain of pixels that coincide in a pattern, it reads text from images,this is what you'de have to do to read text,howerver, most OCRs are unreliable and challenging because they are pretty picky as to what to register as a character and what not to. Link to comment Share on other sites More sharing options...
Squirrely1 Posted July 21, 2006 Share Posted July 21, 2006 (edited) Say I want to search for certain words in a window, can autoit find letters or text like it does pixel colors? This is untested but borrows from what was said by Paulie and requires that you have found what control might have the text in question. and that it will consistently be that control ID number you get by using the AutoIt Window Info tool found under Start button > All Programs > AutoIt v3 Opt("WinTitleMatchMode", 4) Global $searchString, $ret, $controlID $searchString = "my text" $controlID =;[insert ID found using AutoIt Window Info] $ret = ControlGetText($myWindow, $searchString, $controlID) If StringInStr($ret, $searchString) Then MsgBox(0, "Success", "Your text is there.") Else MsgBox(0, "Sorry", "Your text was no not found.") EndIf Otherwise you could try this: Opt("WinTitleMatchMode", 4) Global $searchString, $ret $searchString = "my text" $ret = WinGetText($myWindow, $searchString) If StringInStr($ret, $searchString) Then MsgBox(0, "Success", "Your text is there.") Else MsgBox(0, "Sorry", "Your text was no not found.") EndIf Edited July 21, 2006 by Squirrely1 Das Häschen benutzt Radar Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 21, 2006 Moderators Share Posted July 21, 2006 This is untested but borrows from what was said by Paulie and requires that you have found what control might have the text in question. and that it will consistently be that control ID number you get by using the AutoIt Window Info tool found under Start button > All Programs > AutoIt v3 Opt("WinTitleMatchMode", 4) Global $searchString, $ret, $controlID $searchString = "my text" $controlID =;[insert ID found using AutoIt Window Info] $ret = ControlGetText($myWindow, $searchString, $controlID) If StringInStr($ret, $searchString) Then MsgBox(0, "Sorry", "Your text isn't there.") Else MsgBox(0, "Success", "Your text was no not found.") EndIf Otherwise you could try this: Opt("WinTitleMatchMode", 4) Global $searchString, $ret $searchString = "my text" $ret = WinGetText($myWindow, $searchString) If StringInStr($ret, $searchString) Then MsgBox(0, "Sorry", "Your text isn't there.") Else MsgBox(0, "Success", "Your text was no not found.") EndIfHe's needing something to read image text not actual text. That's why he referred to the OCR script above. 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. Link to comment Share on other sites More sharing options...
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