[Generative AI · Minutes] Semi-automate transcript formatting with GAS × API (prompts, one step further)
- 8 hours ago
- 4 min read
In our earlier "prompt collection for everyday work," we introduced a prompt that turns a meeting transcript into minutes. Copy-pasting it each time is handy enough, but as meetings pile up, the round trip — paste, run, copy, move back to a doc — gets tedious. This article connects that work with GAS (Google Apps Script) and a generative-AI API, so you just paste a transcript and get formatted minutes out: a "semi-automated" setup, one step further.
*This introduces one technical example. API usage may incur charges. Follow your company's rules for confidential information. This article contains affiliate links (Amazon Associates).
What we'll build: semi-automatic minutes from a pasted transcript
The mechanism is simple. Paste a transcript into a spreadsheet, run it from a menu, and GAS calls the generative-AI API and writes the formatted minutes into the next cell (or a Google Doc or Slack). All a person does is "paste," "run," and "final check."
・Input: the transcript pasted into the spreadsheet
・Process: GAS sends a fixed prompt to the API
・Output: formatted minutes (decisions and ToDos separated)
STEP 01 What you'll need
You need these four things. Even without programming experience, it's within copy-paste range.
・A Google account (spreadsheet = GAS is available)
・A generative-AI API key (Claude, ChatGPT, etc.)
・The transcript you want to format (text from a meeting recording)
・About 30 minutes for initial setup
Note Don't write the API key directly in the code — save it in Script Properties. As covered below, not embedding keys in code is a basic security measure.
STEP 02 Turn the prompt into a fixed template
The key to semi-automation is not writing the prompt each time, but fixing it as a set template. We reuse the minutes prompt introduced last time, as-is.
Below is a meeting transcript. Turn it into readable minutes.
Structure: "Date/time, attendees (as known) / Agenda / Decisions / Pending & issues / ToDos (owner, due)".
Summarize verbose remarks and remove duplicates.
Transcript:Append the transcript body after this text and send it to the API. With a fixed template, you get consistent-quality minutes every time.
STEP 03 Call the generative-AI API from GAS
From the spreadsheet menu, open "Extensions → Apps Script" and paste the following code. Here we use Claude's API as an example (the idea is the same for other APIs — just swap the endpoint URL and parameters).
function formatMinutes() {
const props = PropertiesService.getScriptProperties();
const API_KEY = props.getProperty('ANTHROPIC_API_KEY');
const sheet = SpreadsheetApp.getActiveSheet();
// read the transcript pasted in A1
const transcript = sheet.getRange('A1').getValue();
const template =
'Below is a meeting transcript. Turn it into readable minutes.\n' +
'Structure: "Date/time, attendees / Agenda / Decisions / Pending & issues / ToDos (owner, due)".\n' +
'Summarize verbose remarks and remove duplicates.\nTranscript:\n';
const res = UrlFetchApp.fetch('https://api.anthropic.com/v1/messages', {
method: 'post',
contentType: 'application/json',
headers: {
'x-api-key': API_KEY,
'anthropic-version': '2023-06-01'
},
payload: JSON.stringify({
model: 'claude-sonnet-5', // replace with the latest available model name
max_tokens: 2000,
messages: [{ role: 'user', content: template + transcript }]
}),
muteHttpExceptions: true
});
const data = JSON.parse(res.getContentText());
const minutes = data.content[0].text;
// write the formatted minutes to B1
sheet.getRange('B1').setValue(minutes);
}Note The model name changes over time. Replace it with the latest available model name. The API key is registered using the method in the next step.
STEP 04 Register the API key safely
Don't hard-code the API key; save it in Script Properties. In Apps Script, go to "Project Settings → Script Properties" and save it with property name ANTHROPIC_API_KEY and your API key as the value. This way, even if you share the code, the key isn't leaked.
STEP 05 Make it runnable from a menu
Finally, add a dedicated menu that appears when the spreadsheet opens, so you can run it in one click. Adding the following function makes a "Minutes Tool" menu appear.
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('Minutes Tool')
.addItem('Format transcript', 'formatMinutes')
.addToUi();
}Now, paste a transcript into A1, click "Format transcript" from the menu, and the minutes appear in B1.
One step further: expand the output
Once you're comfortable, changing the output makes it even more useful. For example, emailing yourself a notification when formatting finishes is easy.
// notify yourself by email when formatting is done
MailApp.sendEmail('info@robin-planning.com', 'Minutes are ready', minutes);・Write to a Google Doc and share it directly
・Split decisions and ToDos into a separate sheet for task management
・Post to Slack or Chat to share with participants immediately
Things to watch out for
・Confidential info: since data goes to an external API, always check company rules on customer names and personal data.
・API cost: the longer the transcript, the more tokens and cost. Split long meetings.
・Fact-check: AI summaries are handy, but a person should confirm decisions and numbers.
・Rate limits: running a lot in a short time may hit limits. Space out batch processing.
Wrap-up: prompts get powerful when you "fix and connect" them
Once you have a good prompt, the next step is to "fix and connect" it with GAS and an API. Just removing the repeated copy-paste greatly cuts the effort of making minutes. Start with one meeting, and once it works, expand the output. Combined with the earlier "prompt collection," your daily work gets even easier.
Robin Planning can help From organizing prompts to automating routine work with GAS and APIs, we can work together to fit your situation. Feel free to reach out.
Books to go deeper (PR)
For those who want to get more out of GAS and generative-AI APIs.
Book (PR) Intro to Google Apps Script For learning spreadsheet automation from the basics.
Book (PR) Guide to Building with Generative-AI APIs For learning API-based apps and automation.
Book (PR) The Prompt Handbook For raising the quality of your instructions (prompts).
Disclaimer: The code here is a general example and does not guarantee behavior. Check the provider's latest information for API specs and pricing. Handling of confidential information and fact-checking of outputs are the user's responsibility. Affiliate: Robin Planning participates in the Amazon Associates Program and may earn referral fees from purchases via links on this site.

Comments