GetText Non-Performance

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

GetText Non-Performance

Post by armsys » Mon Apr 01, 2013 12:42 pm

Lately I encounter another bug tormenting me for the last 6 months.
GetText has never worked for me.
The following code will generate a null result:
GetTextInit
GetWindowTextEx>Text Capture Component - GetWord - Mozilla Firefox,result
mdl>result

Yes, I notice GetWord_x64.exe (4,928K from http://www.TextCapture.com) is loaded successfully into memory.

In fact, with Text Capture Wizard, it doesn't show any found text for all kinds of windows.

Please help. Thanks.

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

Post by Marcus Tettmar » Mon Apr 01, 2013 5:58 pm

The GetText functions work with many windows apps - it will work with any windows app which uses the Windows TextOut set of functions to render text. But not all apps do so it won't work with all apps. E.g. it doesn't currently read text from Chrome which uses proprietary text rendering methods. I don't know about FireFox but it could be the same. If you use the wizard and point it at the e.g. the desktop, notepad and explorer you'll see that it returns text. So it's a case of suck it and see. Not all apps produce text as far as Windows is concerned. This topic has been dealt with on my blog a number of times:

http://www.mjtnet.com/blog/2009/01/23/s ... scheduler/
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Tue Apr 02, 2013 9:52 am

Before posting my opening thread, I have already exhausted almost all popular apps known to mankind but the GetText fails me. Of course, I'll continue my quest to seek out the solution.
Thanks for your reply.

bnc1
Pro Scripter
Posts: 127
Joined: Sun Jul 31, 2005 5:10 pm

Post by bnc1 » Tue Apr 02, 2013 10:11 am

GetWindowTextEx on maximized windows has not worked for me for a long time going back to Macro Scheduler v13. I mentioned this problem in two older support tickets as part of separate issues. The same problem still exists in v14. I have had to resort to GetTextinRect as a workaround.
Last edited by bnc1 on Tue Apr 02, 2013 10:13 am, edited 1 time in total.

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

Post by Marcus Tettmar » Tue Apr 02, 2013 10:12 am

Have you tried using the text capture wizard?

It won't work with the latest version of FireFox or Chrome but DOES work with IE9.

Also works fine with Notepad, Calculator, the Desktop, other Windows apps.

We've used it with many other third party apps also.

Works with many, but not all.

Have you initialised the library by calling GetTextInit first.

Before trying to use the commands make sure you use the wizard to verify that the text can be captured. Use the first option, hold Shift down and move the cursor over the text you want to capture.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

bnc1
Pro Scripter
Posts: 127
Joined: Sun Jul 31, 2005 5:10 pm

Post by bnc1 » Tue Apr 02, 2013 10:36 am

For a maximized window if I run the following code :

Code: Select all

getactivewindow>winname,xpos,ypos
mdl>%xpos% %ypos%
exit>0
I get results -9 -9 ,negative values! I believe this may be the cause of the problem when using GetWindowTextEx with maximized windows. If I "shrink" the same window to something less then maximized, then GetWindowTextEx works. I understand that text functions in general do not always collect any data depending on the the nature of the window. My issue is that it never seems to work when the window is maximized.

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Tue Apr 02, 2013 10:51 am

Marcus,
Thanks to your encouraging words, I test it agin.
This time and the first time, with 14.0.6, the Text Capture Wizard shows text captured from other apps such as PaerPort. So GetText is working now.
Thanks for your patient help.

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Tue Apr 02, 2013 11:02 am

Hi BNC1,
Thanks for your timely post. Upon reading your post, I test it immediately with maximized and non-maximized windows repeatedly. I confirm your observation is surprisingly correct. Indeed, my last post was successful because the PaperPort was not fully maximized. Otherwise, if maximized, no text could be captured. No wonder I failed in the past.
Thanks again for sharing your observation with us.

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