GetTextInRect Inconsistencies

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
seott
Newbie
Posts: 8
Joined: Wed Mar 11, 2009 6:41 pm

GetTextInRect Inconsistencies

Post by seott » Thu Mar 12, 2009 5:41 pm

Anyone else having inconsistent results with GetTextInRect? I've ran the function a few times on the exact same block of text and sometimes get a blank and sometimes get the text. Messing with the coordinates a bit makes the results -more- consistent but not totally consistent. If I run it 10 times it'll probably work 8 or 9. Is there something I could be doing wrong?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Mar 12, 2009 5:44 pm

Which version of Macro Scheduler are you using? The text capture functions are more reliable in v11 which uses a later version of the text capture libraries.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

seott
Newbie
Posts: 8
Joined: Wed Mar 11, 2009 6:41 pm

Version 11

Post by seott » Thu Mar 12, 2009 6:40 pm

Using version 11 as of this morning and I'm getting these results.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Mar 12, 2009 6:43 pm

There are some valid reasons why it will sometimes come back blank. The app may be busy/unresponsive when the function is called. I always recommend calling GetTextInRect in a loop. Loop until text returned. You'll notice that the text capture sample uses a loop.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

seott
Newbie
Posts: 8
Joined: Wed Mar 11, 2009 6:41 pm

Gotcha

Post by seott » Thu Mar 12, 2009 7:08 pm

Brilliant. Will do. Thanks!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts