Details on new GetTextInRect and GetTextAtPoint functions?
Moderators: Dorian (MJT support), JRL
Details on new GetTextInRect and GetTextAtPoint functions?
I've downloaded the manual and searched the forums/website with nothing found. These sound very useful and some more info detailing how they work and what they do would be great. Are they OCR-like functions which work on images, or do they just work on text boxes and such?
Thanks
Thanks
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
I have not tried them yet, but both commands are in the version 10 HELP section.
It should be simple enough to try them, just change the x/y values in the sample scripts.
It should be simple enough to try them, just change the x/y values in the sample scripts.
Last edited by Bob Hansen on Wed Jan 02, 2008 5:21 pm, edited 1 time in total.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
They are both documented in the help file and the new "Text Capture" sample script shows them in action.
If you opted not to install the samples you can download the new v10 ones here:
http://www.mjtnet.com/software/v10samples.zip
If you opted not to install the samples you can download the new v10 ones here:
http://www.mjtnet.com/software/v10samples.zip
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?
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
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?
I have used the GetTextInRect function to grab the text in a button on a form and it works fine when running in hte Script editor. When I try to run the exact same code in the Macro Scheduler window, it doesn't recognize the text. Any ideas why this might be happening?
I am using version 10.1.02.
Thanks,
Susan
I am using version 10.1.02.
Thanks,
Susan
Hi larkspur,
- Can you post your script? That makes troubleshooting much easier.
- Do you have Macro Scheduler Pro (that includes the compiler) and if so, could you compile the script and let us know if that works properly?
Thanks Susan
Interesting.larkspur wrote:I have used the GetTextInRect function to grab the text in a button on a form and it works fine when running in hte Script editor. When I try to run the exact same code in the Macro Scheduler window, it doesn't recognize the text. Any ideas why this might be happening?
I am using version 10.1.02.
Thanks,
Susan
- Can you post your script? That makes troubleshooting much easier.
- Do you have Macro Scheduler Pro (that includes the compiler) and if so, could you compile the script and let us know if that works properly?
Thanks Susan
jpuziano
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Hi,
Thanks for the quick reply. I have copied the script below. We do have the Pro version. I will try to create a compiled version. The script I am sending you is part of many scripts that are called from one main script. Will the EXE be able to handle this?
Thanks again,
Susan
[/code]
Thanks for the quick reply. I have copied the script below. We do have the Pro version. I will try to create a compiled version. The script I am sending you is part of many scripts that are called from one main script. Will the EXE be able to handle this?
Thanks again,
Susan
Code: Select all
/////////////////////////////////////////////
// Script to Find Specific Text for a button on the toolbar
/////////////////////////////////////////////
/* This macro will try to find text passed to the Script in the buttons of the toolbar
Pass the following parameters
iOpt=1 -
iOpt=2 -
iOpt=3 -
pVal=text to find
return - 0 means value was found -- 1 means value was not found
Call the macro - Macro>O:\qa_macro\MMS_doExit.scp /iOpt=2
*/
// include the Variables Init and Event handling Macros
Include>O:\qa_macro\MMS_INIT.scp
Include>O:\qa_macro\MMS_WINEvents.scp
Let>result=0
Let>Macro_Result=0
//starting point for Y Coord in Toolbar
Let>Y1=0
Let>Y2=0
Let>YCoord=43
//Let>msText = ""
// try to force the MMS window to be active in case it became inactive
ifWindowOpen>MMS-*,FindVal,GoExit
SRT>FindVal
SetFocus>MMS-*
wait .1
// find the Value passed in the Toolbar
Label>mainloop
Let>Y1=%YCoord% + 36
Let>Y2=%YCoord% + 52
GetTextInRect>730,%Y1%,791,%Y2%,msText
Position>%pVal%,%msText%,1,nFoundVal
if>{(%nFoundVal%>0) or (%YCoord%>540)}
GoTo>EndLoop
else
Let>YCoord=%YCoord% + 53
Endif
Wait>0.1
Goto>mainloop
Label>EndLoop
if>%nFoundVal%>0
Wait>.5
//Click Enter at the Coordinate where the value was found
Let>Y1=%YCoord% + 25
MouseMove>750,%Y1%
Wait>.1
LCLICK
// Press Enter
else
Let>result=1
endif
GoTo>GoExit
End>FindVal
Label>GoExit
Let>MACRO_RESULT=%result%
exit>result