OCR Help

Hi, I was following this discussion and did all steps detailed by @TIMAI2 in his homepage. I got the app running under the companion without running errors. But, ... instead of reading the text, I got a HTML code. Since I was using the GoogleOCRBlank.aia I have no clue where the error can be. I thought it should be in the Web1.gotText but I could not change it. If it helps, I am using an Android 12 version.

thanks for your help

The script is not working as you expect.

Will need to see everything in order to find the problem: blocks, script

Confirm you have successfully deployed the web app and you are using the correct script url

I used the script posted in your page as it was. No changes made. As I never uses google script I followed your instructions from: METRIC RAT AI2 - HOWTO: Create a Google Apps Script Web App bound to a Spreadsheet. The blocks also are those coming with the aia (GoogleOCRBlank.aia - Google Drive)
I deployed the web app and then copied the url the system showed to me in that page. What else can I do?
The only one thing I have changed is that I allowed the script just for me (not por everyone else). Can that be the reason? if so, how can I change it?

Yes it most definitely can :slight_smile:

This is why I stress the actions below in all my guides. App Inventor "knows nothing" about Google account logins, and Google "knows nothing" about App Inventor not knowing this :wink:

You need to create/publish a new version of the script, and set it to "Anyone" (new script editor) / "Anyone,even anonymous" (legacy editor)

With that done, it should work.

Unfortunately it still shows me a html format. It is different from the previous one.

From your error it looks like the script is unable to get the FolderById for the creation of the image and Google Document....did you add your folderId to the script?

@ line 5
//provide here a folder ID for the creation of the image file
var fileID = DriveApp.getFolderById('your folder ID here').createFile(blob).getId();

If the folder ID is this:
image

then, I just did (I did not see it before) but still get the same output

That looks a bit long for a folder ID...looks like the google apps script key

Open the folder in Google Drive and look in the url address bar, what do you see ? Like this ?

image

You want this part:

1AxRiM413mxWb6DsXhc4ugq_2GTo1-GY6

No way. Still the same. But dont worry. I will keep trying different alternatives (I will create the script again, among other possible things) and tomorrow will let you know If succeeded

There are not really any alternatives....

Follow the guide, read everything carefully...