A simple Google Apps Script that connects Google Drive + Google Docs + Gemini AI to digitize vintage magazines, lists, and articles.
- AI-Powered: Uses Gemini 1.5 Flash (or newer) for high-accuracy OCR.
- Format Aware: Detects tables/columns automatically and formats them as pipes (
|) for easy spreadsheet conversion. - Batch Processing: Processes entire folders of JPEGs at once.
- User Friendly: Adds a custom menu to Google Docs.
- Open a new Google Doc.
- Go to Extensions > Apps Script.
- Copy the code from
Code.gsin this repository and paste it into the editor. - Get an API Key: Go to Google AI Studio, create a free API key.
- Paste your key into the code where it says
PASTE_YOUR_API_KEY_HERE. - Enable Drive API: In the Apps Script editor, click "Services" (+) on the left, search for "Drive API", and add it.
- Save and Refresh your Google Doc.
- You will see a new menu: π Archivist Tools.
- Click Run Image-to-Text OCR.
- Paste the link to your Google Drive folder containing images.
- Watch the text appear!
The script processes images in alphabetical order (A-Z) based on the filename. To ensure your pages appear in the correct order in the Google Doc, use sequential numbering with leading zeros:
- β
Scan_001.jpg,Scan_002.jpg,Scan_010.jpg - β
Page1.jpg,Page10.jpg,Page2.jpg(Computer sorting will often put Page 10 before Page 2)
Google Apps Script has a strict time limit (6 minutes for free accounts). If you are processing a large folder, the script will stop before finishing. This is normal.
How to fix it:
- Simply click Run again.
- The script has "Smart Resume" logic: it looks at your Google Doc, sees which files are already finished, and automatically skips them.
- Repeat this process until you see the
β OCR Complete!message.