This add-on runs in Google Docs™ and uses the Google™ AI (Gemini™) API to transcribe metric book images. Choose one of the installation options below. The API key can be entered the first time you run Transcribe Image (the add-on will prompt you), or set manually in Script properties.
flowchart LR
Start([Start]) --> Choose{Which option?}
Choose -->|End user<br/>Easiest| O0["Option 0<br/>Marketplace"]
Choose -->|Standalone script<br/>Test in any doc| O1[Option 1<br/>Test deployment]
Choose -->|One document only| O2[Option 2<br/>Container-bound]
Choose -->|clasp / repo sync| O3[Option 3<br/>Deploy from repo]
O0 --> Key0["Set API key<br/>(prompted on first Transcribe)"]
O1 --> Key1["Set API key<br/>(in-app or Script properties)"]
O2 --> Key2["Set API key<br/>(in-app or Script properties)"]
O3 --> Key3["Set API key<br/>(in-app or Script properties)"]
Key0 --> Done([Use add-on])
Key1 --> Done
Key2 --> Done
Key3 --> Done
| Path | Best for |
|---|---|
| Option 0 | Recommended. Install from the Google Workspace™ Marketplace — one click, works in any Google Docs™ document. |
| Option 1 | Standalone Apps Script project; run in any doc via Test deployments (Editor add-on). |
| Option 2 | One Google Doc; script lives inside that document (Extensions → Apps Script). |
| Option 3 | Using clasp or copying from repo; then follow Option 1 or 2 depending on project type. |
This is the easiest option for end users. No code, no setup — just install and go.
flowchart LR
A["🏪 Open Marketplace listing"] --> B[📥 Install]
B --> C[📄 Open any Google Doc]
C --> D["🔑 Set API key<br/>(prompted on first Transcribe)"]
D --> E([✅ Ready])
That’s it — you can now import images from Drive and transcribe them. See the User Guide for step-by-step usage.
Use this option if your script lives in a standalone Apps Script project (e.g. created at script.google.com). You run it in the context of a document via Test deployments.
⚠️ Important: Test deployments must use the Editor add-on type and have a test document selected. Without this, the add-on menu will not appear in the document.
flowchart LR
A[📂 Open standalone<br/>Apps Script project] --> B[📋 Check appsscript.json]
B --> C[🚀 Deploy → Test deployments]
C --> D[➕ Editor add-on<br/>+ Add test doc]
D --> E[▶️ Execute test]
E --> F[📄 Doc opens<br/>Authorize]
F --> G["🔑 Set API key<br/>(prompted on first Transcribe<br/>or via Script properties)"]
G --> H([✅ Ready])
appsscript.json matches the repo (no addOns block; includes script.container.ui scope). See addon/appsscript.json.docs/TestDeployments_popup.jpg for reference if available.)GEMINI_API_KEY with your key. (Note: the in-app dialog stores the key and model per user; manual Script properties are shared across all users of the project.)The add-on runs in the context of the test document. When you run Transcribe Image, a dialog shows “Awaiting response from Gemini API… This may take up to 1 minute.” To test with the latest code, keep Latest code in the test and refresh the document after saving changes.
Use this option to attach the add-on directly to one document. The script is bound to that document.
flowchart LR
A[📄 Open Google Doc] --> B[🔌 Extensions → Apps Script]
B --> C[📝 Paste Code.gs, Prompt.gs<br/>Update appsscript.json]
C --> D[💾 Save]
D --> E[▶️ Run onOpen]
E --> F[🔄 Reload document]
F --> G["🔑 Set API key<br/>(prompted on first Transcribe<br/>or via Script properties)"]
G --> H([✅ Menu appears])
Code.gs content and paste the contents of addon/Code.gs from this repo.addon/Prompt.gs.appsscript.json and replace its contents with addon/appsscript.json from this repo.Use this option if you use clasp or want to keep the add-on in sync with this repository.
flowchart LR
A[📥 Clone repo] --> B{How to deploy?}
B -->|clasp| C[📦 npm install clasp<br/>clasp login]
B -->|Manual| D[📋 Copy addon/* files]
C --> E[🚀 clasp create / push<br/>--rootDir addon]
E --> F["🔑 Set API key<br/>(prompted on first Transcribe<br/>or via Script properties)"]
D --> F
F --> G{Bound or standalone?}
G -->|Bound to doc| H[▶️ onOpen + Reload]
G -->|Standalone| I[Use Option 1<br/>Test deployment]
H --> J([✅ Ready])
I --> J
cd into it.npm install -g @google/claspclasp loginclasp create --type docs --title "Metric Book Transcriber" --rootDir addon (or clone an existing project and set rootDir to addon).clasp push.addon/Code.gs, addon/Prompt.gs, and addon/appsscript.json into your Apps Script project (create one from a document via Extensions → Apps Script, or create a standalone at script.google.com).The manifest (appsscript.json) includes an addOns block with a logoUrl pointing to the icon hosted in this repo. The logoUrl must be a public HTTPS URL (e.g. a GitHub raw URL or Cloud Storage). Required sizes for the Marketplace listing: 128×128 px and 32×32 px (square, color, transparent background). See addon/img/README.md for details.
| Issue | What to do |
|---|---|
| Menu doesn’t appear | Reload the document. For container-bound scripts, ensure the script is bound to this document (Extensions → Apps Script opens the same project). For test deployments, run Execute from Deploy → Test deployments. |
| “Please set your Google AI API key” / no key | Run Transcribe Image — the add-on will prompt you to enter a key and choose a model, with a link to Google AI Studio. Or use Setup API key & model to set or change key and model. |
| “Authorisation is required to perform that action” | You may be a collaborator on the doc (not the person who added the add-on). Install the add-on for your account: Extensions → Metric Book Transcriber and complete the authorization when prompted. Or remove and re-add the add-on to re-authorize. |
| Quota exceeded / 429 | Free tier has limited requests per day (e.g. ~20 for Gemini Flash Latest). The add-on shows the API error in the dialog. Check rate limits; consider enabling billing or switching model via Setup API key & model. |
| Cannot access folder (Import from Drive) | Ensure the folder is shared with you or you own it. If using a custom GCP project (e.g. for Marketplace), enable the Google Drive API in that project: APIs & Services → Library → Google Drive API. Re-authorize the add-on if you changed permissions. |
| API errors / 403 | Confirm the API key is valid and the Generative Language API is enabled. Check Google AI Studio or Cloud Console. |
| Timeout | The script uses a 60-second timeout. Try a smaller image or try again. |
For usage (document structure, Context section, step-by-step with screenshots), see USER_GUIDE.md.