I had a script I made on a trial version that used GetTextAtPoint to make sure the mouse was at the right spot on a web page. Worked great.
Then I registered and upgraded to 10.1.02 and it just stopped working. Searching the forums revealed a different issue related to the same command: Known issue in 10.1: Some apps report error on exit
On a whim, I grabbed those old DLL's, and it fixed my problem too. GetTextAtPoint returns a value with the older DLL's, but only an empty string with the ones that come with 10.1.02.
Hopefully this is on the list to be fixed along with the other issue?
GetTextAtPoint returns nothing
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
This needs to be on the frequently asked questions list because I'm often answering this. I'll sort that.
Usually this is a timing thing, and GetTextAtPoint needs to be in a loop. The reason is that the app you are getting text from is not reporting it all the time, and the time you perform the GetTextAtPoint you may get nothing back. Run the Text Capture sample and point the mouse at the position and you sould see the text. The reason the Text Capture sample usually works where your script does not is that the sample script is running everything in a loop, so it keeps checking. So we often need to try something like:
So the script keeps looking until it gets a result. Of course you could build a timeout into this if you want.
But first check with the text capture sample macro and see if you always get a result with that. If so it should work when you use a loop.
Usually this is a timing thing, and GetTextAtPoint needs to be in a loop. The reason is that the app you are getting text from is not reporting it all the time, and the time you perform the GetTextAtPoint you may get nothing back. Run the Text Capture sample and point the mouse at the position and you sould see the text. The reason the Text Capture sample usually works where your script does not is that the sample script is running everything in a loop, so it keeps checking. So we often need to try something like:
Code: Select all
Label>wait_text
GetTextAtPoint>x,y,text
If>text=,wait_text
But first check with the text capture sample macro and see if you always get a result with that. If so it should work when you use 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?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?