Skip to content

Instantly share code, notes, and snippets.

View tanaikech's full-sized avatar

Kanshi TANAIKE tanaikech

View GitHub Profile
@tanaikech
tanaikech / submit.md
Created March 25, 2025 05:22
Enhanced Text Manipulation in Google Slides using Google Apps Script

Enhanced Text Manipulation in Google Slides using Google Apps Script

Description

This is a sample Google Apps Script designed to replace all instances of specific text within a Google Slides presentation, while simultaneously applying a desired text style. The built-in Presentation.replaceAllText() method within the Google Slides service is limited; it efficiently replaces text strings but lacks the functionality to modify text formatting during the replacement process. This limitation poses a challenge when aiming for styled text replacements. This report presents a detailed script solution that overcomes this constraint. The script iterates through all text elements within the slides, identifies matching text, and performs a replacement. Crucially, it also applies specified text formatting attributes, such as font, font size, color, and bold/italic settings, to the replaced text. This enhanced functionality allows users to maintain c

@tanaikech
tanaikech / submit.md
Created March 21, 2025 06:54
Slide Puzzle in Google Sheets

Slide Puzzle in Google Sheets

Abstract

This report demonstrates the onSelectionChange simple trigger in Google Sheets by creating a slide puzzle. Selecting cells triggers script execution, enabling interactive gameplay.

Introduction

@tanaikech
tanaikech / submit.md
Last active March 21, 2025 01:41
Generate Growing Images using Gemini API

Generate Growing Images using Gemini API

Abstract

Gemini API now generates images via Flash Experimental and Imagen 3. This report introduces image evolution within conversations using Gemini API with Google Apps Script.

Introduction

@tanaikech
tanaikech / submit.md
Last active March 17, 2025 07:28
Create Visualized Recipe Instructions with Gemini using Google Apps Script

Create Visualized Recipe Instructions with Gemini using Google Apps Script

Abstract

This report presents a Google Apps Script for generating visualized cooking recipes with text and images using the Gemini API, leveraging its image generation capabilities.

Introduction

@tanaikech
tanaikech / submit.md
Created March 15, 2025 06:33
Generate Images with Gemini API using Google Apps Script

Generate Images with Gemini API using Google Apps Script

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.

Usage

@tanaikech
tanaikech / submit.md
Last active March 15, 2025 04:52
Workaround: Smart Chips with Google Apps Script

Workaround: Smart Chips with Google Apps Script

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. This report introduces a workaround for achieving this.

Workaround

The flow of workaround in this report is as follows.

@tanaikech
tanaikech / submit.md
Created March 12, 2025 05:16
Creating Tree Structure from Headings in Google Documents using Google Apps Script

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

Description

This is a Google Apps Script for creating the tree structure from headings in Google Documents.

Usage

@tanaikech
tanaikech / submit.md
Created March 10, 2025 05:19
Technique for Changing Glyph Colors of Bullets in Google Documents Using Google Apps Script

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

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

@tanaikech
tanaikech / submit.md
Created March 9, 2025 07:04
Trend of google-apps-script Tag on Stackoverflow 2025

Trend of google-apps-script Tag on Stackoverflow 2025

Published: March 9, 2025

Kanshi Tanaike

Introduction

On Stack Overflow, numerous users post questions and answers daily across various tags. These discussions, spanning a wide range of topics, provide valuable information and are highly beneficial. One such tag is "google-apps-script," where I occasionally participate in discussions. Observing these threads over time, it's evident that they evolve alongside updates to Google Apps Script, the technology at the core of the tag. This report aims to analyze this evolution as a trend within the "google-apps-script" tag. This trend encompasses changes in the number of questions, questioners, answerers, and associated tags. The evolution of the "google-apps-script" tag is closely linked to the development of Google Apps Script and its diverse applications.

@tanaikech
tanaikech / submit.md
Created December 12, 2024 03:07
Workaround: Export web-published Google Docs as PDFs using Google Apps Script

Workaround: Export web-published Google Docs as PDFs using Google Apps Script

Abstract

This report outlines a Google Apps Script solution for directly exporting web-published Google Docs to PDF. By circumventing limitations in published URLs, the script enables convenient PDF generation without manual intervention.

Introduction

Google Sheets and Google Docs offer the convenient feature of web publishing, providing readily accessible URLs for sharing. Ref