copyright Posted September 19, 2004 Posted September 19, 2004 how would i read the last line of text such as.. (chat window screen) and store that line into a variable !? is this possible ?
Developers Jos Posted September 19, 2004 Developers Posted September 19, 2004 how would i read the last line of text such as.. (chat window screen) and store that line into a variable !? is this possible ? <{POST_SNAPBACK}>Something like this? (untested) $Wtext = WinGetText("xyz","") $LastLine = StringTrimLeft($WText,StringInstr($Wtext,@LF,0,-1)) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
ezzetabi Posted September 19, 2004 Posted September 19, 2004 Maybe it is better... $Wtext = WinGetText("xyz","") Select Case StringInStr($Wtext,@crlf) $S = @crlf Case StringInStr($Wtext,@lf) $S = @lf Case StringInStr($Wtext,@cr) $S = @cr EndSelect $LastLine = StringTrimLeft($WText,StringInstr($Wtext,$S,0,-1)) ...just to be sure that the window uses the @lf. Or WinGetText always returns @lf ?
copyright Posted September 20, 2004 Author Posted September 20, 2004 Maybe it is better... $Wtext = WinGetText("xyz","") Select Case StringInStr($Wtext,@crlf) $S = @crlf Case StringInStr($Wtext,@lf) $S = @lf Case StringInStr($Wtext,@cr) $S = @cr EndSelect $LastLine = StringTrimLeft($WText,StringInstr($Wtext,$S,0,-1)) ...just to be sure that the window uses the @lf. Or WinGetText always returns @lf ? <{POST_SNAPBACK}>i think i got it to work ..but, how would i read the... second to the last line ?
copyright Posted September 21, 2004 Author Posted September 21, 2004 hey.. check this: $Wtext = WinGetText("xyz","") Select Case StringInStr($Wtext,@crlf) $S = @crlf Case StringInStr($Wtext,@lf) $S = @lf Case StringInStr($Wtext,@cr) $S = @cr EndSelect $LastLine = StringTrimLeft($WText,StringInstr($Wtext,$S,0,-1)) it works.. (if i change -1 to -2.. it reads the second to the last line.) but, heres what i am really getting start> chatnick> testing 1..2..3.. <end problem is there is a return before what i need and 2 returns afterwards.. . how do i just get "chatnick> testing 1..2..3.." ? someone please help.
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