Jump to content

Search for text on screen?


Recommended Posts

Well, your query is kinda vague and general, but if it's as simple as checking that a known window is currently displaying a known string, something as simple as the following might suffice:

$someWindowTitle = "Pictures of ferrets dot ee ex ee"
$someWindowText = "This one is totally wearing a party hat"
$isThere = winactivate($someWindowTitle, $someWindowText)
If $isThere Then
;do some stuff
Else
;do some other stuff
EndIf
;more stuff
Exit

Now, if you're not checking that it's "there" per se, but rather that it is going to be there within the next ten seconds, you might wanna go with something along the lines of:

$someTimeoutInSeconds = 10
$isThere = winwaitactive($someWindowTitle, $someWindowText, $someTimeoutInSeconds)
If $isThere Then
;do some stuff
Else
;do some other stuff
EndIf
;more stuff
Exit
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...