A Google Workspace Add-on for Google Drive that streamlines the process of text recognition (OCR) and document merging.
Do you have multiple photos of a document or several PDF files from which you want to extract and combine the text? OCR-combi solves this problem. This add-on uses Google's built-in OCR functionality to recognize text in multiple image or PDF files at once. It then merges the recognized text from all these files into a single, well-organized Google Document, directly in your Google Drive.
The standard OCR process in Google Drive is cumbersome:
- Right-click on a single file.
- Choose "Open with" -> "Google Docs".
- Wait for the conversion to complete.
- Repeat this for every file.
- Open each new document, copy the text, and paste it into a master document.
OCR-combi automates these steps. You select all your files, click one button for the conversion, then select the new documents and click another button to merge everything. This saves a significant amount of time and mouse clicks.
- Batch OCR: Perform text recognition on multiple files (
.jpg,.png,.gif,.pdf) at once. - Automatic Merging: Combine the text from multiple Google Docs into a new, single document.
- Location Preservation: The final combined document is placed in the same folder as the source files.
- Sorting Options: Choose to sort the documents alphabetically (A-Z) or reverse alphabetically (Z-A) before merging.
- Clear Separators: Each combined text block is provided with a clear header and separator, so you can see the origin of each text.
- Timeout Protection: A built-in limit prevents the script from stopping when processing too many files at once.
This add-on is not distributed through the official Google Workspace Marketplace. Google's verification requirements (such as a verified domain name and an expensive security audit) are too burdensome for a small-scale, open-source project.
Therefore, you will follow a manual installation procedure. During this process, Google will show you a warning like "Google hasn't verified this app". This is normal and expected for scripts you install yourself. You are only giving yourself permission to run the script in your own account. The code is fully public in this repository, so you can verify for yourself that your data is not being misused.
Follow these steps carefully to install the add-on.
- Go to script.google.com.
- Click on + New project in the top left.
You will replace the default files with the code from this repository.
- In the Apps Script project, you will see a file named
Code.gs. - Delete all existing code in this file.
- Copy the entire content of the
Code.gsfile from this repository. - Paste the copied code into the empty
Code.gsin your Apps Script project.
- In the editor, click the + icon next to "Files".
- Choose Script.
- Name the new file
Strings(the.gsextension will be added automatically). - Copy the entire content of the
Strings.gsfile from this repository. - Paste the copied code into your new
Strings.gsfile.
- On the left, click the Project Settings icon (gear ⚙️).
- Check the box Show "appsscript.json" manifest file in editor.
- Go back to the Editor (icon
<>). You will now see theappsscript.jsonfile. - Delete all existing content in this file.
- Copy the entire content of the
appsscript.jsonfile from this repository. - Paste the copied code into your
appsscript.jsonfile.
The script needs an advanced service to perform OCR.
- In the editor, click the + icon next to "Services".
- Find Google Drive API in the list and select it.
- Click the Add button. You should now see "Drive" under the list of Services.
Click the Save project icon (diskette 💾) at the top.
- In the top right, click the blue Deploy button and choose New deployment.
- Next to "Select type", click the gear icon (Enable deployment types).
- Select Add-on.
- Give the deployment a description (e.g., "Version 1").
- Click Deploy.
- After deployment, a window "Deployment updated" will appear. Copy the Add-on URL. It looks like
https://script.google.com/macros/d/{ID}/addon?authuser=0. - Click Done.
- Paste the copied URL into a new browser tab and press Enter.
- You will see an installation screen for "OCR Combi". Click Install and then Continue.
This is the step where the warning appears.
- Choose the Google account you want to use the add-on with.
- You will see the screen "Google hasn't verified this app". This is the expected warning.
- Click Advanced.
- At the bottom, click the link Go to [Name of your project] (unsafe).
- Review the requested permissions (for Drive and Documents) and click Allow.
The add-on is now installed and ready to use!
- Go to your Google Drive.
- Select one or more image files (
.jpg,.png, etc.) or PDFs. - The OCR-combi sidebar will automatically appear on the right. (If not, refresh the page).
- Step 1: Convert. Click the button
Step 1: Convert X image(s). The script will convert each file to a Google Doc with the prefix[OCR]. - Step 2: Combine. Wait for the conversion to finish. Now select all the new
[OCR]documents in your Drive. - The sidebar will update. Choose the desired sort order and click
Step 2: Combine X document(s). - A new document named
Combined Text - ...will be created containing all the text. You can open it directly via the link in the add-on.
Note: The individual [OCR] documents are not automatically deleted, so you can check the conversion for each file. You can delete them manually after you are satisfied with the final result.
Please feel free to set up the project as a Google Chrome Web Store extension.
The original author does not have a personal web domain, which is a new requirement by Google for oAuth-verification for extensions that use Google/YouTube APIs via the Google Cloud Platform (since Manifest v3).
It is a good program and the author uses it locally (which is allowed by Google). It would be beneficial to the community if someone made a publicly available Chrome extension out of it.
This software is provided "as is", without warranty of any kind, express or implied. The author is not liable for any loss of data or damage arising from the use of this software. Use at your own risk.
This project is licensed under the MIT License. There is no LICENSE file in this repository, but the standard MIT license terms apply.