Expanding Error Messages of Google Apps Script using Gemini Pro API with Google Apps Script

Gists

Expanding Error Messages of Google Apps Script using Gemini Pro API with Google Apps Script

Abstract

It is considered that when the current error message of Google Apps Script is expanded, it will be useful for a lot of users. This report introduces a sample script for expanding the error message of Google Apps Script using Gemini Pro API with Google Apps Script.

Introduction

The recent release of the LLM model Gemini as an API on Vertex AI and Google AI Studio opens a world of possibilities. Ref and Ref

Flexible Labeling for Gmail using Gemini Pro API with Google Apps Script

Gists

Flexible Labeling for Gmail using Gemini Pro API with Google Apps Script

Abstract

The release of Gemini API is expected to expand the future of Google Apps Script. This report introduces a sample script for flexible email labeling in Gmail using Gemini API with Google Apps Script.

Introduction

The recent release of the LLM model Gemini as an API on Vertex AI and Google AI Studio opens a world of possibilities. Ref and Ref I believe Gemini API significantly expands the potential of Google Apps Script and paves the way for diverse applications. In this report, I present a sample script for flexible email labeling in Gmail using Gemini Pro API with Google Apps Script.

Automatically Creating Descriptions of Files on Google Drive using Gemini Pro API with Google Apps Script

Gists

Automatically Creating Descriptions of Files on Google Drive using Gemini Pro API with Google Apps Script

Abstract

Gemini LLM, now a Vertex AI/Studio API, unlocks easy document summarization and image analysis via Google Apps Script. This report details an example script for automatically creating the description of the files on Google Drive and highlights seamless integration options with API keys.

Introduction

Recently, the LLM model Gemini has been released and is now available as an API on Vertex AI and Google AI Studio. Ref and Ref This report presents a simple Google Apps Script example for automatically creating descriptions of files on Google Drive using the Gemini Pro API. It is considered that when the description of files on Google Drive can be easily created, it will help users manage a lot of files.

Drive API v3 has been released to Advanced Google services

Recently, when Drive API is enabled at Advanced Google services with the script editor, Drive API v3 is automatically used. In the official document, Drive API v3 has already been used. Ref In the current stage, the users can select V3 and V2.

When Drive API v3 is used with Advanced Google services, the following advantages can be considered.

  1. Drive API v3 can be used with only the scopes for Drive API without adding a scope https://www.googleapis.com/auth/script.external_request.
  2. The files and folders can be searched by the search query of createdTime. Ref

References:

Managing Footnotes on Google Documents using Google Apps Script

Gists

Managing Footnotes on Google Documents using Google Apps Script

Description

Google Documents can be managed by the Document service of Google Apps Script. Ref One day, you might have a situation in which you are required to manage the footnotes on Google Documents using Google Apps Script. There are several official documents related to the footnotes for Google Apps Script. Ref and Ref However, unfortunately, I’m worried that it might be difficult a little to understand the management of the footnotes from these documents. Actually, I saw some questions related to the footnotes on Google Documents at Stackoverflow. In this report, I would like to introduce a method for managing the footnotes on Google Documents using Google Apps Script.

Technique for Managing Rich Text on Google Spreadsheet using Google Apps Script

Gists

Technique for Managing Rich Text on Google Spreadsheet using Google Apps Script

Abstract

One day, you might have a situation where you are required to manage rich texts in Google Spreadsheet using Google Apps Script. In this report, I would like to introduce the basic technique for managing rich texts with Google Apps Script.

Introduction

At Google Spreadsheet, rich texts can be used as a cell value. The rich texts can be also managed by Google Apps Script. Ref When I saw the official document related to the rich texts with Google Apps Script, I’m worried that it might be difficult a little for users to manage the rich texts using Google Apps Script.

Workaround: Making Users Edit Protected Cells using Google Apps Script

Gists

Abstract

One day, you might have a situation where you are required to make users edit the protected cells using Google Apps Script. This report introduces a workaround for achieving this situation. The key factors for achieving this are as follows. 1. Run the script as the owner of Spreadsheet even when the script is run by a user. 2. In order to run the script as the owner, the installable triggers and the Web Apps are used.

Technique of Array Processing for Custom Functions on Google Spreadsheet using Google Apps Script

Gists

Technique of Array Processing for Custom Functions on Google Spreadsheet using Google Apps Script

Description

At Google Spreadsheet, custom functions created by Google Apps Script can be used. Ref When the custom function is used, the users can create a function for expanding the built-in functions for Spreadsheet. One day, you might have a situation for executing the custom function using an array. For example, under the situation that your custom function uses a single value instead of an array as the argument, when you want to use an array for each argument of the custom function, it is required to modify the original script of the custom function or the function calling the custom function. In this report, I would like to introduce a technique of array processing for the custom functions on Google Spreadsheets.

Technique for Processing Google Spreadsheet Including Merged Cells using Google Apps Script

Gists

Description

At Google Spreadsheet, the cells can be merged as one cell. But, when the Spreadsheet including the merged cells is used with Google Apps Script, the script becomes a bit complicated. Also, I sometimes find some questions like this situation on Stackoverflow. In this report, I would like to introduce a technique for easily using the Spreadsheet including the merged cells with Google Apps Script.

Principle

Before it introduces the sample scripts, I would like to introduce the principle for using the Spreadsheet for the merged cells. You can understand the principle of this method from the following sample input and output images.