Details on new GetTextInRect and GetTextAtPoint functions?

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
DrPain
Newbie
Posts: 10
Joined: Sun Mar 26, 2006 2:38 pm

Details on new GetTextInRect and GetTextAtPoint functions?

Post by DrPain » Wed Jan 02, 2008 1:56 pm

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

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Wed Jan 02, 2008 3:43 pm

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

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

Post by Marcus Tettmar » Wed Jan 02, 2008 3:53 pm

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
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

User avatar
JRL
Automation Wizard
Posts: 3526
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed Jan 02, 2008 4:49 pm

DrPain wrote:Are they OCR-like functions which work on images
They are not OCR functions so they will not work on graphic imagery.
DrPain wrote:or do they just work on text boxes and such?
That would be correct.

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

Post by Marcus Tettmar » Wed Jan 02, 2008 4:50 pm

Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

DrPain
Newbie
Posts: 10
Joined: Sun Mar 26, 2006 2:38 pm

Post by DrPain » Wed Jan 02, 2008 5:00 pm

Thanks all. I don't have version 10 or I would have tried it myself. Still using 9.1 and thought this might be a good reason to upgrade (if it did the OCR thing). I know OCR is a tall order and didn't really expect it to be true, but just had to ask. :)

larkspur
Newbie
Posts: 5
Joined: Fri Apr 25, 2008 9:03 pm

Post by larkspur » Fri May 16, 2008 4:31 pm

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

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Fri May 16, 2008 4:38 pm

Hi larkspur,
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
Interesting.

- 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 - :-)

larkspur
Newbie
Posts: 5
Joined: Fri Apr 25, 2008 9:03 pm

Post by larkspur » Fri May 16, 2008 4:51 pm

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: 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
[/code]

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