Jump to content

How to check and only proceed if a text box has a portion of text in it?


Recommended Posts

Ok when i perform a certain text a text field within the application is populated with some text how do i use autoit to first text if there is a portion of specific text in the text field before proceeding. Notice i said portion so even if it only checks the first few letters or a word that exists i think that is sufficient enough for this to work! Any help would be greatly appreciated.

:-)

Edited by simpleraison
Link to comment
Share on other sites

"the application"

What application, your own ?

Its a third party application that was developed by a programmer on a bespoke basis. Hence the reason i use 'the application' as opposed to giving the actual name as thats about the same level of insight as the other as noone will have heard of it or is very unlikely anyone else owns it unless the programmer who created it browses these boards!

Edited by simpleraison
Link to comment
Share on other sites

If StringInStr(ControlGetText("Window Title","",$ControlID),"Your chosen string") <> 0 Then
EndIf

Where $ControlID is the ID of the text field, "Window Title" is the window containing the field, and "Your chosen string" is whatever the specific string you're testing for is. If that does NOT equal 0, then proceed with script. Dude.

-Fett

Edited by fett8802
[sub]My UDF[/sub][sub] - Basics and Time extensions. Great for those new at AutoIt, also contains some powerful time extensions for pros.[/sub][sub]ScrabbleIt[/sub][sub] - Scrabble done in pure AutoIt. (In Progress)[/sub][sub]Nerd Party Extreme | My Portfolio | [email="fett8802@gmail.com"]Contact Me[/email][/sub]
Link to comment
Share on other sites

If StringInStr(ControlGetText("Window Title","",$ControlID),"Your chosen string") <> 0 Then
EndIf

Where $ControlID is the ID of the text field, "Window Title" is the window containing the field, and "Your chosen string" is whatever the specific string you're testing for is. If that does NOT equal 0, then proceed with script. Dude.

-Fett

Fett nice one dude! Just needed someone like you to pop in and help me out! That was a very clear and concise answer!
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...