Sign in to follow this  
Followers 0
pdug175

parsing data from a window

12 posts in this topic

Hello, my first post - pleased to meet you all.

I am after some help as I'm trying to parse data from the current window in view(stuff in the Visible Window Text ). Is anyone in possesion of any simple scripts that loads the current windows data into autoit for analysis. Thank you.

:o

Share this post


Link to post
Share on other sites



...I'm trying to parse data from... (stuff in the Visible Window Text )...

Do you mean like this?
$var = StringSplit(WinGetText(""), @CRLF)
For $i = 1 To $var[0]
    MsgBox(0, "$var[" & $i & "]", $var[$i])
Next

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Nice Plato... i had'nt ever seen that one

8)

Edited by Valuater

NEWHeader1.png

Share this post


Link to post
Share on other sites

Do you mean like this?

Nice Plato... but consider using the StringSplit optional flag when the split parameter is more then 1 char.

Share this post


Link to post
Share on other sites

Nice Plato... but consider using the StringSplit optional flag when the split parameter is more then 1 char.

As much as I use StringSplit and @CRLF, you would think that I would have learned that by now :-(

Thanks for the kind reminder.

$var = StringSplit(WinGetText(""), @CRLF)
For $i = 1 To $var[0]
    ConsoleWrite("$var[" & $i & "]" & $var[$i] & @CR)
Next

$var = StringSplit(WinGetText(""), @CRLF, 1)
For $i = 1 To $var[0]
    ConsoleWrite("$var[" & $i & "]" & $var[$i] & @CR)
Next

>Running: (3.1.1.108):C:\Program Files\AutoIt3\beta\autoit3.exe "C:\Temp\SciTE-temp.au3"

$var[1]Source

$var[2]$var = StringSplit(WinGetText(""), @CRLF)

$var[3]

$var[4]For $i = 1 To $var[0]

$var[5]

$var[6] ConsoleWrite("$var[" & $i & "]" & $var[$i] & @CR)

$var[7]

$var[8]Next

$var[9]

$var[10]

$var[11]

$var[12]$var = StringSplit(WinGetText(""), @CRLF, 1)

$var[13]

$var[14]For $i = 1 To $var[0]

$var[15]

$var[16] ConsoleWrite("$var[" & $i & "]" & $var[$i] & @CR)

$var[17]

$var[18]Next

$var[19]>"C:\Program Files\AutoIt3\SciTE\CompileAU3\CompileAU3.exe" /run /beta /ErrorStdOut /in "C:\Temp\SciTE-temp.au3" /autoit3dir "C:\Program Files\AutoIt3\beta" /UserParams

$var[20]>Running AU3Check C:\Program Files\AutoIt3\SciTe\Defs\Unstable\Au3Check\au3check.dat

$var[21]

$var[22]>AU3Check Ended. No Error(s).

$var[23]

$var[24]>Running: (3.1.1.108):C:\Program Files\AutoIt3\beta\autoit3.exe "C:\Temp\SciTE-temp.au3"

$var[25]

$var[26]

$var[27]li=6 co=44 INS (CR+LF)

$var[28]

$var[1]Source

$var = StringSplit(WinGetText(""), @CRLF)

$var[2]For $i = 1 To $var[0]

$var[3] ConsoleWrite("$var[" & $i & "]" & $var[$i] & @CR)

$var[4]Next

$var[5]

$var[6]$var = StringSplit(WinGetText(""), @CRLF, 1)

$var[7]For $i = 1 To $var[0]

$var[8] ConsoleWrite("$var[" & $i & "]" & $var[$i] & @CR)

$var[9]Next

>"C:\Program Files\AutoIt3\SciTE\CompileAU3\CompileAU3.exe" /run /beta /ErrorStdOut /in "C:\Temp\SciTE-temp.au3" /autoit3dir "C:\Program Files\AutoIt3\beta" /UserParams

>Running AU3Check C:\Program Files\AutoIt3\SciTe\Defs\Unstable\Au3Check\au3check.dat

$var[10]>AU3Check Ended. No Error(s).

$var[11]>Running: (3.1.1.108):C:\Program Files\AutoIt3\beta\autoit3.exe "C:\Temp\SciTE-temp.au3"

$var[12]

li=6 co=44 INS (CR+LF)

>AutoIT3.exe ended.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Nice Plato... i had'nt ever seen that one

8)

Thanks... but is it what the original post requested?

I guess that StringSplit meets the request to "parse data".

...and the code that I posted meets the request for "simple scripts".


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Thanks... but is it what the original post requested?

I guess that StringSplit meets the request to "parse data".

...and the code that I posted meets the request for "simple scripts".

Hey plato, I was trying out your script. And I tried to write $var to a file with FileWrite() problem is... it just comes up as a blank. Anything I have to do to be able to do so?

EDIT: Nvm... was just me being stupid on that one....

New problem is that when it does write to the file, it only writes part of what was in the window...

Edited by Flawblure

Share this post


Link to post
Share on other sites

Hey plato...New problem is that when it does write to the file, it only writes part of what was in the window...

From the help file on the WinGetText function:

Remarks

Up to 64KB of window text can be retrieved.

How much text are you "getting"? And why would you want to do it that way. Frankly, I cannot see a use for code like I posted - unless you are trying to log quick changes to a window.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

This really is excellent - worked a treat, thanks for the help. I should be well on my way to completing this script now. I'll let you know how I get on later on this weekend. :o

A

Share this post


Link to post
Share on other sites

This really is excellent...

Glad to help...

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

It stopped at 33kb. And I am trying to record quick changes. I'm trying to record AIM messages and then run whatever is messaged and read by your script as code... of course after getting rid of the HTML stuff. Unless theres a way to littlerally just read the text someone sent.

Share this post


Link to post
Share on other sites

It stopped at 33kb. And I am trying to record quick changes. I'm trying to record AIM messages and then run whatever is messaged and read by your script as code... of course after getting rid of the HTML stuff. Unless theres a way to littlerally just read the text someone sent.

I don't now why it would stop at 33kb and I do not know of another way to "read" the AIM window... but you should probably start a separate thread for your issue.

[size="1"][font="Arial"].[u].[/u][/font][/size]

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