Jump to content

Only getting partial window text from WinGetText


jmoskie
 Share

Recommended Posts

I've had two other threads here so far, and they've both been extremely helpful in getting my first public AutoIt program off the ground. I've just going one more annoying issue.

As mentioned before, my program is a screen scraper. I have a loop where the program finds the window and uses WinGetText($window) to read the text from the window. This works perfectly most of the time, but sometimes it will only get a partial read. This is causing my Array Out of Bounds errors that I mentioned in a previous thread, but I've gotten to script to gracefully handle those.

I'm curious why sometimes I'll only get a partial scrape. What could cause this? No errors are being reported that I can see.

Link to comment
Share on other sites

I'm curious why sometimes I'll only get a partial scrape. What could cause this? No errors are being reported that I can see.

WinGetText

--------------------------------------------------------------------------------

Retrieves the text from a window.

WinGetText ( "title" [, "text"] )

Remarks

Up to 64KB of window text can be retrieved

If you have large text in that win this can b your problem

Did you try with ControlGetText?

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

The majority of the time, all of the text is retrieved successfully.

As mentioned before, this text getting is in a loop, and immediately before the partial scrape, I got a full scrape of the entire window, which is more than double the length of the partial one.

Dumping the partial scrape to disk, it's < 4KB. I don't think I'm hitting this issue.

I'll play around with ControlGetText. Hopefully the controls on the program I'm scraping are labeled well.

Link to comment
Share on other sites

Can you at least post your code, 3 threads and you did not post the script that your haveing problems with.

Did you try to read it 2 times and compare it if first win read and second are identical? Maby that win is still writing while your trying to get text?

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
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...