Save text from screenshot into variable

hsurB

Well-known member
Do You have any plans in adding action to save entire text from screenshot into variable?
I am assuming if there is option to check, its possible to save all of it is as well.
I don't think I've ever been more excited for an update! Was about to post it in 5.42 beta feedbeck directly but didn't want to interrupt more important discussions there.
 

Dimlos

Well-known member
It would certainly be useful if implemented.
Perhaps we could use Read Screen Contents before taking a screenshot.
 

mapriex

Active member
i am curious. it must be working with image ai screening. i hope same pictures give the same output, but i think it will work most times seamlessly.
 

MacroDroidDev

Administrator
Staff member
I am planning this and it will probably write into an array in this case. I'm going to have a look at it soon and it may sneak into v5.42 if it proves to be easy, else it will go into the v5.43 release
 

MartinNL123

New member
It's working in 5.43!
With one limitation however, it only seems to parse text into the Array that is visible on the phone screen.

When taking a screenshot with the "Show standard Android Screenshot UI" option I scroll down to capture the whole image of the app, so the screenshot is a lot longer then the physical pixel height of the phone.
The text parsing stops at the edge of the physical pixels, but the actual screenshot could be 2 or 3 times that.

Can I change that myself with some config?
Or is it not possible at all?
Or can it work that it uses the whole screenshot with all pixels to parse the text? (feature request?)

See the example screenshot.
 

Attachments

  • Screenshot_20240402_063230_Tesla Example.jpg
    Screenshot_20240402_063230_Tesla Example.jpg
    728.2 KB · Views: 9

hsurB

Well-known member
Oh that would be cool too (if its possible to achieve)
I can see myself using it cause in some mobile versions of app both read screen content and screenshot can save only whats on screen. On some websites read screen captures everything (but not on all of them).
 

MartinNL123

New member
It's certainly not possible to capture things that are not currently on the screen using this mechanism.
There are commands for screen and screenshots, so I assumed screenshot means the actual screenshot taken?

[10]: Check Text On Screen
[12]: Read Screenshot Contents
[16]: Check Text In Screenshot
[18]: Read Screen Contents
 

MartinNL123

New member
It's certainly not possible to capture things that are not currently on the screen using this mechanism.
Looking at the docs in the Add Action screen it says:
"Check Text In Screenshot
This action is similar to the 'Check Text
On Screen, but it will take a screenshot
of the current screen and use OCR to
try and detect textual content. It can be
used in games and other apps where text
is drawn to the screen but it may not be
100% reliable at detecting all text."

So I think it takes its own screenshot as input and not the screenshot that I am taking by scrolling the screen?
 

MartinNL123

New member
Oh pity, I am taking a screenshot in the Macro, manually do the scroll thing, and then I coded Read Screenshot, but that is then not the one I wanted, because it takes its own screenshot without scrolling.

The only way then to do OCR on my "own" screenshot is with a plugin?
 
Top