tanaike

The Thinker

Generate Images with Gemini API using Google Apps Script

Gists Description Recently, image generation was supported in the Gemini API using Gemini 2.0 Flash Experimental and Imagen 3. This report introduces simple sample scripts for generating images using the Gemini API with Google Apps Script. When images can be created using the Gemini API with Google Apps Script, Google Apps Script, which seamlessly integrates with Google Docs, Sheets, and Slides, becomes a powerful tool for creating and managing them, and the applications are infinite.

Updated: GAS Library - GeminiWithFiles

GeminiWithFiles was updated to v2.0.4 v2.0.4 (March 15, 2025) Property generationConfig was added to the method geminiWithFiles. By this, you can use all properties for generationConfig. Ref You can see the sample scripts at “Use googleSearch for grounding” and “Generate image”. You can see the detail information here https://github.com/tanaikech/GeminiWithFiles

Workaround: Smart Chips with Google Apps Script

Gists Description Now, Google Docs and Google Sheets can insert smart chips. Smart chips are very useful for easily inserting information like users, maps, files, and so on. However, unfortunately, at the current stage, smart chips cannot be directly managed using Google Apps Script. Specifically, the information within smart chips cannot be directly retrieved by Google Apps Script. Although I believe this will be resolved in a future update, there might be cases where you want to retrieve information from smart chips using Google Apps Script.

Creating Tree Structure from Headings in Google Documents using Google Apps Script

Gists Description This is a Google Apps Script for creating the tree structure from headings in Google Documents. Usage In order to test this script, please do the following steps. 1. Sample Document Create a sample Document as follows. 2. Sample script Open the script editor and copy and paste the following script. In this script, Document service (DocumentApp) is used. function sample1() { const headTypes = [ "TITLE", "HEADING1", "HEADING2", "HEADING3", "HEADING4", "HEADING5", "HEADING6", ]; const body = DocumentApp.

Technique for Changing Glyph Colors of Bullets in Google Documents Using Google Apps Script

Gists Description This report introduces a sample script for changing the glyph colors of bullets in lists on Google Documents using Google Apps Script. Currently, there are no built-in methods for achieving this using either the Document service (DocumentApp) or the Docs API. However, this can be accomplished through a specific process. This report will introduce that process using Google Apps Script. Principle When the foreground color of the text within a list is changed using the Google Document service (DocumentApp), the bullet glyphs are not affected.