cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mktranslation
Helper I
Helper I

Problem with OCR text

I need your help once again! I will be appreciated!

I need to do an operation after a specific text appear in the text box on th screen here:

mktranslation_0-1642688976677.png

I thought the only solution is to use text on screen ocr action. But.. it doesn't work 🙂

I have two problems with it. Once I have my specific value, lets say 999 in this field, nothing happens and the flow is waiting forever. However, as soon as I switch window to PAD, where the value 999 is visible, the flow resumes as if the value is read from another window but not from Illustrator (entire procedure before is done in Illustrator, so its windows is active).

But this is only one issue. Another one is that it doesn't work with variables. Even from PAD window. 

What I mean is, when I don't set fixed value in the action, it does work (only after switching to PAD windows), but when I set it in a variable, nothing happens even then.

mktranslation_1-1642690020112.png

I want to be able to read from Illustrator the value from the variable %last%.

Any ideas why this flow doesn't work? Or what are my alternatives?

10 REPLIES 10
Benny_1857
Helper III
Helper III

I do not use OCR wait as it request Windows install language English.
So I will choose Image Wait as a specific text but be a specific image also. ^_^

What do you mean exactly? I do have English installed in the system. I don't see the image wait as a solution. I have dozens of files and each have a different number I need to wait for. That is why I need a variable. With your proposed solution, I would need to create tens of images and I don't even know how I could loop them...

Benny_1857
Helper III
Helper III

Benny_1857_0-1642760328386.png

That is the error information I get. My window do not install in English and I need to add a language kit.

Microsoft.Flow.RPA.Desktop.Robin.SDK.ActionException: Windows 中未安装语言 '英语',请在计算机上添加语言包。当前安装的语言是 中文(简体,中国) 并且可以与 Windows OCR 一起使用
在 Microsoft.Flow.RPA.Desktop.Modules.OCR.Actions.TextOnScreenActionBase.TextExistsOnScreen()
在 Microsoft.Flow.RPA.Desktop.Modules.OCR.Actions.WaitTextOnScreenAction.Execute(ActionContext context)
在 Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)

For your request solution, I cannot not provide OCR solutions to you as I cannot use it.

But I believe we do not have only one solution.

So I have some question.

As you said, you have a dozen of files. Do you mean once you have the value you need to trigger a specific action?

If it is, I would use Data extraction to pick it from UI element into text. Then use "IF" and "ELSE" to judge the text or compare with a list. Make a further action after that. 

By the way, do you know the regulation of the value you have?

A specific action needs to be triggered once this value appears on the screen 😞 So I don't see any other solution here. The thing is that in the previous steps I automatially generate files from Illustrator and this process of generation is finished once you can see the number of the screen. That is why this action seemed the perfect one, apart from that it doesn't work. Can you try with Tesseract engine? Maybe this will not require any installations on your side.

Yet another way to solve this issue I thing is to wait for specific time of inactivity. Do you know how could I do it?

A specific action needs to be triggered once this value appears on the screen 😞 So I don't see any other solution here. The thing is that in the previous steps I automatially generate files from Illustrator and this process of generation is finished once you can see the number of the screen. That is why this action seemed the perfect one, apart from that it doesn't work. Can you try with Tesseract engine? Maybe this will not require any installations on your side.

Yet another way to solve this issue I thing is to wait for specific time of inactivity. Do you know how could I do it?

Benny_1857
Helper III
Helper III

For your last question, if only wait, you could use WAIT which is in flow control.

You said 'once you can see the number of the screen. ' 

But I do not find any number in your first picture attched. 

I try to understand your request. Your software is generate file. But you do not know how long it will takes.
So you will wait it complete to generate file. After the flow will go next step.

If it is. I have a solution before. Once you software complete generate a file, it will store it in some folder. So you could count the file number in this folder. Once it > 0, trigger the next step and move it to a new folder for next loop. You could use a small loop to check whether the folder has new file or not evrey 10sec or 1min.

Benny, thank you for your engagement. Here is a little bit more. I can't use WAIT because the process can take anywhere from 1 minute to 20 minutes. And I would like it to be optimal not to waste time.

And yes, I generate files. But... the process for each loop item may generate different number of files - again this depend on the xml file.

In other words, Illustrator opens AI file and then XML file. XML file is used to create data sets that are imported to AI file. From each dataset two files are saved (AI and PDF). Each XML file can have a different number of data sets. Once the appropriate XML is loaded, I use built-in Illustrator function to batch apply data sets and bath export AI and PDF files. The process of export is done after the last data set is reached. For each XML, the number of last data set is different. I hope this is quite clear 🙂 If not, please ask. At the end the screen looks like that: 

mktranslation_0-1642765691901.png

 

So also, I can't wait for files because I don't know how many files will be generated in a specific loop iteration.

Benny_1857
Helper III
Helper III

It is a little complicated to explain for me.

Just like you generate A1,A2,A3,A4... then, you will do B1,B2,B3,B4...
My suggestion is generate A1, then do B1, after this loop, generate A2, then do B2....

Unluckly, I do not have that software which I cannot experience the detail problem you have.

😅

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (2,629)