tanaike

The Thinker

Consolidate Scattered A1Notations into Continuous Ranges on Google Spreadsheet using Google Apps Script

Gists Abstract Consolidate scattered cell references (A1Notation) in Google Sheets for efficiency. This script helps select cells by background color or update values/formats, overcoming limitations of large range lists. Introduction When working with Google Spreadsheets, there might be a scenario where you need to process scattered A1Notations (cell addresses in the format “A1”). This could involve selecting cells with specific background colors, updating cell values, or modifying cell formats. One approach to handle scattered A1Notations is to create a range list containing the individual cell coordinates and activate it.

Specifying Output Types for Gemini API with Google Apps Script

Gists Abstract The Gemini API generates different outputs depending on the prompts. This report explains how to use function calling in the new Gemini 1.5 API to control the output format (string, number, etc.) within a script during a chat session. This allows for more flexibility in using the Gemini API’s results. Introduction The appearance of Gemini has already brought a wave of innovation to various fields. When the Gemini API returns a response, the format of the response is highly dependent on the input text provided as a prompt.

Identifying Colored Cell Regions in Google Sheets with Google Apps Script

Gists Overview This Google Apps Script helps identify and analyze regions of colored cells in a Google Sheet. Description Recently, I encountered a situation where I needed to identify colored cell regions in Google Sheets. For instance, consider the following spreadsheet: The region enclosed by the red cells (B2:D4) is a rectangle. In this case, the closed region can be easily identified using a simple script in Google Sheets. However, the region enclosed by the blue cells (H3, I2, J2,,,) is more complex.

Parsing Invoices using Gemini 1.5 API with Google Apps Script

Gists Abstract This report explores using Gemini, a new AI model, to parse invoices in Gmail attachments. Traditional text searching proved unreliable due to invoice format variations. Gemini’s capabilities can potentially overcome this inconsistency and improve invoice data extraction. Introduction After Gemini, a large language model from Google AI, has been released, it has the potential to be used for modifying various situations, including information extraction from documents. In my specific case, I work with invoices in PDF format.