Screen OCR problem

General Macro Scheduler discussion

Moderators: JRL, Dorian (MJT support)

Post Reply
CarlosR
Newbie
Posts: 2
Joined: Mon Jan 05, 2009 3:02 pm

Screen OCR problem

Post by CarlosR » Mon Jan 05, 2009 3:16 pm

I'm trying to use Textract for screen OCR, as described by Marcus in a post HERE.

The problem that I have is that the underlying application is not well behaved. The cell from which I am trying to extract data changes width unpredictably. This cell doesn't have much on either side of it, so I can partially resolve the problem by just making the capture window so large that no matter where the numerical data is entered, it's always in the capture window. The problem is that the numbers I want are followed by a percent sign (%), which I don't want. I could screen that out by setting the OCR window to exclude it, except for this problem of the cell getting wider, and the numbers inside then being in a different screen position.

Any ideas as to how can I resolve this with a minimum of complexity?

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 Jan 05, 2009 4:42 pm

What kind of text are you trying to extract and from what application? You may not need to use OCR. You may be able to use the built-in text capture functions.
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
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Mon Jan 05, 2009 5:55 pm

Hi CarlosR,

If the other methods Marcus mentioned don't work, then assuming you are using Textract and have increased the capture window large enough so that you always get your data into a variable (let's call it my_var)... if the problem is only that the data includes the percent % sign at the end... you can get rid of any percent signs with just one Macroscript command:
  • StringReplace>my_var,%,,my_var_no_percent_signs
Take care
Last edited by jpuziano on Wed Jan 07, 2009 5:29 pm, edited 2 times in total.
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 - :-)

CarlosR
Newbie
Posts: 2
Joined: Mon Jan 05, 2009 3:02 pm

Post by CarlosR » Tue Jan 06, 2009 5:15 am

Hi guys,

I'm pretty sure that OCR is the only way to go here. This is from a special-purpose program that is not using the normal Windows text display modes.

But jpuziano's suggestion may do the job, let me try.

Thanks,

=Carlos=

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