sigil Posted April 27, 2005 Posted April 27, 2005 I want to get the text from a database's interface window and search it for a given string, but ControlGetText hasn't successfully grabbed it. The window looks like a typical interface for a BBS, like the kind one might Telnet into. I've tried this code (which works fine for searching NotePad files for text): $words=ControlGetText("WindowName","",59648) if stringInStr($words,"theTextIWantToFind") then msgbox(0,"output","found it") else msgbox(0,"output","did not find it") endif exit How should I change it?
nobby Posted April 28, 2005 Posted April 28, 2005 Unfortunately there are some "windows" from which you cannot get the text. CheersNobby
DaveF Posted April 28, 2005 Posted April 28, 2005 Is it actually a console application? If it is you may be able to redirect the output from the screen to AutoIt using the STD I/O functions from the current beta version of AutoIt. Example, checks if the current user may dial in to Remote Access: Dim $process, $output, $linesOut, $foundIt $process = Run("netsh.exe", @SystemDir, @SW_SHOW, 3) StdinWrite($process, "ras set user " & @UserName & @CRLF) StdinWrite($process, "bye" & @CRLF) While 1 $output = $output & StdoutRead($process) If @error = -1 Then ExitLoop WEnd $linesOut = StringSplit($output, @CR) For $step = 1 To $linesOut[0] If StringInStr( $linesOut[$step], "Dialin") Then If StringInStr($linesOut[$step], "permit") Then $foundIt = 1 EndIf EndIf Next If $foundIt = 1 Then MsgBox(0, "Success!", "The current user is permitted to dial in to this machine.") Else MsgBox(0, "Failure...", "The current user is not permitted to dial in to this machine.") EndIf Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.
sigil Posted April 28, 2005 Author Posted April 28, 2005 Is it actually a console application? If it is you may be able to redirect the output from the screen to AutoIt using the STD I/O functions from the current beta version of AutoIt.Example, checks if the current user may dial in to Remote Access:Dim $process, $output, $linesOut, $foundIt $process = Run("netsh.exe", @SystemDir, @SW_SHOW, 3) StdinWrite($process, "ras set user " & @UserName & @CRLF) StdinWrite($process, "bye" & @CRLF)<{POST_SNAPBACK}>[code truncated]I'm running version 3.1.0. I couldn't find these functions in the Help file. The public history doesn't indicate that they've been added for 3.1.1, which seems to be the most current version. How do I get a version of AutoIt that incorporates them?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now