jiglei Posted June 22, 2009 Posted June 22, 2009 (edited) Hi there, I'm having a problem to know what I should do, this is how far I could go with my script autoitsetoption("WinTextMatchMode",2) $var2=controlgettext("title", "text",596) IF $Var2="The Text I want" Then "Do what I want" What I pretend is that Auto IT does a certain action if a certain text is found in a certain window. I've looked up everywhere but it seems that this isn't a usualy wanted action, so it's hard to find. So I though I could ask help to those who are more expert in this than me (I'm a begginer at this ) Thanks in advance. EDIT: I posted a wrong Title to this topic :S Edited June 22, 2009 by jiglei
PsaltyDS Posted June 22, 2009 Posted June 22, 2009 Hi there, I'm having a problem to know what I should do, this is how far I could go with my script autoitsetoption("WinTextMatchMode",2) $var2=controlgettext("title", "text",596) IF $Var2="The Text I want" Then "Do what I want" What I pretend is that Auto IT does a certain action if a certain text is found in a certain window. I've looked up everywhere but it seems that this isn't a usualy wanted action, so it's hard to find. So I though I could ask help to those who are more expert in this than me (I'm a begginer at this ) Thanks in advance. EDIT: I posted a wrong Title to this topic :S So, how does that not work for you? You could simplify and it a little: Opt("WinTextMatchMode",2) If ControlGetText("title", "text", 596) = "The Text I want" Then ; Do what I want ; Put code here EndIf But that's just style; it could work the way you had it. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
jiglei Posted June 22, 2009 Author Posted June 22, 2009 What I mean is that the text that the auto IT finds is too big (like 1000 lines) And I just want it to do something if it finds in those 1000 lines a certain sentence (like 5 words) But it will only do something i want if all the text is found, but thats not what I want. Hope you understood me fine now.
PsaltyDS Posted June 22, 2009 Posted June 22, 2009 What I mean is that the text that the auto IT finds is too big (like 1000 lines) And I just want it to do something if it finds in those 1000 lines a certain sentence (like 5 words) But it will only do something i want if all the text is found, but thats not what I want. Hope you understood me fine now. That's pretty trivial to not find it in the help file: Opt("WinTextMatchMode",2) $sText = ControlGetText("title", "text", 596) If StringInStr($sText, "The Text I want") Then ; Do what I want ; Put code here EndIf Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
jiglei Posted July 3, 2009 Author Posted July 3, 2009 That's pretty trivial to not find it in the help file: Opt("WinTextMatchMode",2) $sText = ControlGetText("title", "text", 596) If StringInStr($sText, "The Text I want") Then ; Do what I want ; Put code here EndIf Thanks a lot, it really helped, the delay in reply was because I was on vacations Now that I'm back I can finish my program Thanks once more.
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