Sign in to follow this  
Followers 0
simpleraison

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

8 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

"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

Share this post


Link to post
Share on other sites

..if there is a portion of specific text in the text field before proceeding..

Maybe ControlGetText and StringInStr can be used here?


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

Maybe ControlGetText and StringInStr can be used here?

Cheers dude how would i use it in the context i described above then dude?

Share this post


Link to post
Share on other sites

Cheers dude how would i use it in the context i described above then dude?

Any help on this one dude?

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

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]

Share this post


Link to post
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!

Share this post


Link to post
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
Sign in to follow this  
Followers 0