Jump to content

Text Search


 Share

Recommended Posts

I was just wondering if their is anyway in Auto It to scan only the currently line of text in the document you are in and do something if it finds a line of text. Ive been trying to figure this out, but havent made any progress; so may be some of you Auto It Kings :lmao: can help me here?

Here is the code ive been messing with.

$a = AutoItWinGetTitle()

$b = FileOpen ( $a, 2 )

While 1
    
If FileReadLine( $b ) = "Error " Then
    
    ToolTip("I can fix that.")
    
Else
    
EndIf

WEnd

And thanks for your time. (And hopefuly answer too ;) )

Edited by S.C.G.R.
Link to comment
Share on other sites

$File = Fileopen ("file.txt", 0)

While 1
    $line = FileReadLine($file)
        If @error = -1 Then ExitLoop
        If not StringinStr ($Line, "Text of line you want") > 0 then

;;;;do what you want here

endif
    Wend
    
FileClose ($File)

Edited by ChrisL
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...