Huy guys.
Not sure if this is a newbie question (probably is the case) but there is a way to identify a text pattern inside a form? Please refer to the following image:
gif image hosting
I would like to make an script to hit space if text pattern "MEASURED" and "98.40" is dettected. Looping through all entries (rows).
Cudos from Brazil.
Identify pattern in some form
-
- Posts: 13
- Joined: 09 Nov 2016, 07:11
Re: Identify pattern in some form
I'm thinking it's probably not the case, but if you press control-C while the row is highlighted, does it copy the text of that row to the clipboard? If so, then you can identify the pattern of the text and act upon it as you want. If not, you probably can't do it by matching text.
However, if it's truly only when the highlighted row contains exactly "MEASURED" and "98.40" that you're looking for, then you can easily do it using ImageSearch. Just make reference images of those two pieces of text when they are highlighted. Then you would have two ImageSearch commands that search the entire window for those two pieces of highlighted text, and they will both match only when the highlighted row contains them both. You might need to use a lot of allowable variance for the "98.40" ImageSearch because it can start in a different "x" position, which means the anti-aliasing of that text can be a little different depending on where it shows up (as opposed to "MEASURE" since it consistently starts at the same "x" position so it should always look the same).
However, if it's truly only when the highlighted row contains exactly "MEASURED" and "98.40" that you're looking for, then you can easily do it using ImageSearch. Just make reference images of those two pieces of text when they are highlighted. Then you would have two ImageSearch commands that search the entire window for those two pieces of highlighted text, and they will both match only when the highlighted row contains them both. You might need to use a lot of allowable variance for the "98.40" ImageSearch because it can start in a different "x" position, which means the anti-aliasing of that text can be a little different depending on where it shows up (as opposed to "MEASURE" since it consistently starts at the same "x" position so it should always look the same).
-
- Posts: 13
- Joined: 09 Nov 2016, 07:11
Re: Identify pattern in some form
boiler thanks for your help.
Just checked here and the answer is no, when I ctrl+c this objects nothing is copied to the clipboard.
I will probably have to use imagesearch although I am not experienced with it. Never used actually.
Just checked here and the answer is no, when I ctrl+c this objects nothing is copied to the clipboard.
I will probably have to use imagesearch although I am not experienced with it. Never used actually.
Re: Identify pattern in some form
It's really pretty easy, especially in this case where finding the location isn't the issue because getting the coordinate modes correct is often a source of confusion. In your case, you're just looking for the reference images to appear anywhere, so there's less to worry about. Try it out and post if you have issues.
-
- Posts: 13
- Joined: 09 Nov 2016, 07:11
Re: Identify pattern in some form
Yeah I will try that during the next days. Thanks!
Who is online
Users browsing this forum: AlFlo and 210 guests