Library

GAS Library - TableApp

Overview

TableApp is a Google Apps Script library for managing Tables on Google Sheets.

Description

Recently, a new feature “Tables” was introduced to Google Sheets. Tables allow users to group data into structured tables with headers, filtering, and specific data types. While these can be managed via the Google Sheets API (v4), constructing the raw JSON requests for operations like creating, updating, and managing tables can be complex.

This library, TableApp, creates an object-oriented wrapper around the Google Sheets API, making it easy to manage Tables directly within Google Apps Script.

Accelerating Gemini CLI: A Node.js Wrapper for Google Apps Script MCP Servers

Gists

Abstract

This article introduces a Node.js wrapper that dramatically reduces the startup time for the Gemini CLI when used with MCP servers built on Google Apps Script. This optimization enhances user experience by accelerating the initialization process, achieving a speed boost of approximately 15 times.

1. Introduction

The Model Context Protocol (MCP) is a vital open standard enabling AI agents to connect with external tools and data sources for complex, real-world tasks. To integrate the Gemini AI agent with Google Workspace, I developed two open-source tools: MCPApp, for managing the MCP server lifecycle, and ToolsForMCPServer, a suite of tools for interacting with services like Gmail and Drive. These are built with Google Apps Script for use with the Gemini CLI.

Updated: GAS Library - ToolsForMCPServer

ToolsForMCPServer was updated to v1.0.29

  • v1.0.29 (September 15, 2025)

    1. The following 5 tools were added. These tools provide the information for building the request body of Google APIs.

      • explanation_analytics_data_properties_runReport
      • explanation_analytics_data_properties_runRealtimeReport
      • explanation_manage_google_sheets_using_sheets_api
      • explanation_manage_google_docs_using_docs_api
      • explanation_manage_google_slides_using_slides_api
    2. The following 8 tools were updated.

      • get_google_sheet_object_using_sheets_api
      • manage_google_sheets_using_sheets_api
      • get_google_doc_object_using_docs_api
      • manage_google_docs_using_docs_api
      • get_google_slides_object_using_slides_api
      • manage_google_slides_using_slides_api
      • analytics_data_properties_runReport
      • analytics_data_properties_runRealtimeReport

You can see the detailed information here https://github.com/tanaikech/ToolsForMCPServer

Updated: GAS Library - ToolsForMCPServer

ToolsForMCPServer was updated to v1.0.28

  • v1.0.28 (September 11, 2025)

    1. The following 9 tools were added.

      • create_document_body_in_google_docs
      • remove_files_on_google_drive
      • maps_get_route
      • maps_convert_location_to_lat_lon
      • maps_convert_lat_lon_to_location
      • maps_create_map
      • explanation_create_maps_url
      • explanation_reference_generate_google_apps_script
      • explanation_reference_export_google_sheets_as_pdf
    2. A bug of a tool “convert_mimetype_of_file_on_google_drive” was removed. This is from this issue report.

You can see the detailed information here https://github.com/tanaikech/ToolsForMCPServer

Updated: GAS Library - ToolsForMCPServer

ToolsForMCPServer was updated to v1.0.27

  • v1.0.27 (August 22, 2025)

    1. Following 6 tools for Google Analytics were added.

      • analytics_admin_accountSummaries_list: Retrieves a list of all Google Analytics accounts accessible by the current user
      • analytics_admin_properties_get: Get detailed information about a single Google Analytics property
      • analytics_data_properties_runReport: Fetches a custom report from a Google Analytics property
      • analytics_data_properties_runRealtimeReport: Generates a customized report of real-time event data from a Google Analytics property

You can see the detailed information here https://github.com/tanaikech/ToolsForMCPServer

Updated: GAS Library - MCPApp

MCPApp was updated to v2.0.7

  • v2.0.7 (August 6, 2025)

    1. Starting with v2.0.7, you can now selectively enable or disable the LockService.

      • By default, this library runs with the LockService enabled. To disable it, simply modify return new MCPApp.mcpApp({ accessKey: "sample" }) to return new MCPApp.mcpApp({ accessKey: "sample", lock: false }).
      • When the LockService is disabled (lock: false), asynchronous requests from clients like the Gemini CLI may see an increase in processing speed. However, it’s important to note that the maximum number of concurrent requests must not exceed 30. Please use this option with caution.

You can see the detail information here https://github.com/tanaikech/MCPApp

Updated: GAS Library - ToolsForMCPServer

ToolsForMCPServer was updated to v1.0.12

  • v1.0.12 (July 31, 2025)

    1. At Gemini CLI v0.1.15, prompts/list was called even when prompts wasn’t included in capabilities. This resulted in the error Error discovering prompts from gas_web_apps: MCP error -32001: Request timed out when prompts wasn’t returned for prompts/list. To resolve this, I updated ToolsForMCPServer to return an empty array for prompts, which eliminated the error. Consequently, with this update in v1.0.12, you can now set custom prompts and resources.

You can see the detailed information here https://github.com/tanaikech/ToolsForMCPServer

Updated: GAS Library - ToolsForMCPServer

ToolsForMCPServer was updated to v1.0.10

  • v1.0.10 (July 26, 2025)

    1. When I updated Gemini CLI from v0.1.12 to v0.1.13, an issue related to the schema of MCP occurred. Ref So, as a workaround at the time, I updated this library. But when I updated Gemini CLI to v0.1.14, I confirmed that the previous schema could be used. So, I reimplemented the previous schema. By this, the request body for APIs can be directly generated using Gemini CLI v0.1.14.

You can see the detailed information here https://github.com/tanaikech/ToolsForMCPServer

Updated: GAS Library - ToolsForMCPServer

ToolsForMCPServer was updated to v1.0.8

  • v1.0.8 (July 23, 2025)

    1. An issue occurred when I updated Gemini CLI from v0.1.12 to v0.1.13. Ref Fortunately, Google is already aware of this issue, and I’m awaiting a resolution. In the meantime, I’ve received emails about it, so I’ve updated ToolsForMCPServer for Gemini CLI v0.1.13. The detailed updates are as follows: I confirmed that all tools in ToolsForMCPServer v1.0.8 worked when tested with Gemini CLI v0.1.13.
    • oneOf has been removed from the schema of each tool.
    • Following this report, the request body is now generated on the MCP server side. Therefore, when using the tools manage_google_docs_using_docs_api, manage_google_sheets_using_sheets_api, and manage_google_slides_using_slides_api, please use your API key for the Gemini API.

You can see the detailed information here https://github.com/tanaikech/ToolsForMCPServer

Updated: GAS Library - ToolsForMCPServer

ToolsForMCPServer was updated to v1.0.7

  • v1.0.7 (July 19, 2025)

    1. Added a getToolList method for retrieving all current tools in the library.
    2. Tools can be filtered using enables or disables as an array argument for the getTools method. If enables is used, only the tools specified in the enables array will be used. If disables is used, all tools except those specified in the disables array will be used. If neither enables nor disables is used, all tools will be used.

You can see the detailed information here https://github.com/tanaikech/ToolsForMCPServer

Gmail Processing using MCP Network Powered by Google Apps Script

Gists

Abstract

This report details an MCP network using Google Apps Script for both server and client, enabling automated, secure Gmail processing to boost efficiency.

Introduction

Recently, I published a report titled “Building Model Context Protocol (MCP) Server with Google Apps Script,” which you can find here. In that initial report, I demonstrated the feasibility of creating an MCP server using Google Apps Script, with Claude Desktop serving as the client.

Building Agent2Agent (A2A) Server with Google Apps Script

Gists

Abstract

Exploring Agent2Agent (A2A) protocol implementation in Google Apps Script seamlessly allows AI agents to access Google Workspace data and functions. This could enable complex workflows and automation, overcoming platform silos for integrated AI applications.

Introduction

Agent2Agent (A2A) is a proposed open protocol facilitating communication and collaboration among diverse AI agents, aiming to overcome platform silos and enable complex tasks while preserving agent opacity. This report examines the feasibility of implementing a core A2A server component using Google Apps Script within Google Workspace. Such an implementation could seamlessly allow AI agents to securely access and utilize data and functionalities across Google services like Docs, Sheets, and Gmail via a standardized protocol. This would enable sophisticated AI-powered workflows and automation directly linked to user data. A sample script demonstrates the technical potential despite the current lack of a dedicated Apps Script SDK for A2A. While acknowledging potential Apps Script limitations, such as execution time, this exploratory approach remains valuable for developing internal or user-centric AI applications and integrations within Google Workspace. A successful demonstration could potentially highlight the capabilities of Google Apps Script.

Building Model Context Protocol (MCP) Server with Google Apps Script

Gists

Abstract

This text introduces the Model Context Protocol (MCP) for standardizing AI interaction with external systems. It explores the potential of using Google Apps Script (GAS) to host an MCP server, leveraging GAS’s integration with Google Workspace for data access. A sample script demonstrates feasibility, highlighting the current absence of an official GAS SDK. The work aims to foster understanding and encourage SDK development.

Introduction

Recently, the Model Context Protocol (MCP) has emerged as a standard protocol for connecting AI applications with third-party systems and data sources. Acting like a universal adapter or “USB-C for AI,” the MCP standardizes how AI models can dynamically discover and interact with external resources, tools, and context, often incorporating mechanisms for user consent and secure communication. The detailed specification of this protocol can be confirmed at the official site. Ref

MimeTypeApp: Flexible MimeType Converter with Google Apps Script

Gists

Abstract

This is a Google Apps Script library for converting files from various MIME types to a specified target MIME type. The library accepts both file IDs and blobs as input values.

Introduction

Recently, I encountered a scenario where I needed to convert files of various MIME types to a specific target MIME type. While converting files with known source MIME types is relatively straightforward, the process becomes more complex when the source MIME type is unknown. To simplify this task, I developed a Google Apps Script solution that can effectively convert files of diverse MIME types to a desired target MIME type. The script can accept both file IDs and blobs as input values.

Updated: GAS Library - GeminiWithFiles

GeminiWithFiles was updated to v2.0.3

  • v2.0.3 (November 19, 2024)

    1. I modified the specification of setFileIdsOrUrlsWithResumableUpload. From v2.0.3, when you use this method, please include propertiesService: PropertiesService.getScriptProperties() into the initial object as follows. Because, when PropertiesService.getScriptProperties() is used in the library, the values are put into the library. When I created Ref and Ref, I supposed that the script is used by copying and pasting instead of the library. So, I included PropertiesService.getScriptProperties() in the script. But I noticed that when this is used with GeminiWithFiles, each user is required to use PropertiesService.getScriptProperties(). So, I modified this.
    2. As an additional option, when you want to upload the data with the resumable upload as a new upload, please set resumableUploadAsNewUpload: true. Ref By this, the property is cleared and the upload is run.

You can see the detail information here https://github.com/tanaikech/GeminiWithFiles

Updated: GAS Library - UtlApp

UtlApp was updated to v1.0.7.

  • v1.0.7 (September 4, 2024)

    1. Following 3 methods were added.
    • snake_caseToCamelCase: This method is used for converting a string of the snake case to the camel case.
    • camelCaseTosnake_case: This method is used for converting a string of the camel case to the snake case.
    • createFormDataObject: This method is used for creating the form data to HTTP request from an object.

You can see the detail information here https://github.com/tanaikech/UtlApp

Updated: GAS Library - GeminiWithFiles

GeminiWithFiles was updated to v2.0.0

  • v2.0.0 (August 3, 2024)

    1. From this version, the following changes were made.
    • PDF data can be directly used. Ref By this, PDFApp is not required to be used. By this, the script can be used without async/await.
    • As the default, functions: {} is used. So, the default function calling was removed. Because in the current stage, JSON output can be easily returned using a JSON schema and response_mime_type. Ref Ref
    • The default model was changed from models/gemini-1.5-pro-latest to models/gemini-1.5-flash-latest.
    • The export values with exportTotalTokens were changed. After v2.x.x, when this is true, the object usageMetadata including promptTokenCount, candidatesTokenCount, totalTokenCount is exported. At that time, the generated content and usageMetadata are returned as an object.
    • After v2.x.x, the large files can be uploaded to Gemini. This is from this respository and this post.

You can see the detail information here https://github.com/tanaikech/GeminiWithFiles

Updated: GAS Library - GeminiWithFiles

GeminiWithFiles was updated to v1.0.7.

  • v1.0.7 (July 4, 2024)

    1. From this version, when doCountToken: true and exportTotalTokens: true are used in the object of the argument of geminiWithFiles, the total tokens are returned. In this case, the returned value is an object like {returnValue: "###", totalTokens: ###}. Ref

You can see the detail information here https://github.com/tanaikech/GeminiWithFiles

Updated: GAS Library - MoveFolder

MoveFolder was updated to v1.0.1.

  • v1.0.1 (June 18, 2024)

    1. In the recent update on the Google side, it was found that in the current stage, when the other libraries are loaded from a library, an error like We're sorry, a server error occurred while reading from storage. Error code NOT_FOUND occurs. So, from v1.0.1, the library of BatchRequest is included in this library.

You can see the detail information here https://github.com/tanaikech/MoveFolder

GAS Library - MoveFolder

Overview

This is a Google Apps Script library for moving a folder including files and folders on Google Drive.

Description

This library addresses a common challenge: efficiently moving folders, including their subfolders and files, between Google Drives. This encompasses both personal and shared drives using a script. While Google Drive offers straightforward methods for moving individual files between any drives, directly moving entire folders containing subfolders presents limitations, particularly when shared drives are involved. This script bridges that gap by providing a reliable Google Apps Script solution for such scenarios.

Updated: GAS Library - GeminiWithFiles

GeminiWithFiles was updated to v1.0.4.

  • v1.0.4 (May 29, 2024)

    1. Recently, when model.countToken is used with the uploaded files, I confirmed that an error like You do not have permission to access the File ### or it may not exist. occurred. In order to handle this issue, I modified the library.
    2. In order to use the movie files for generateContent, I modified the library. Ref

You can see the detail information here https://github.com/tanaikech/GeminiWithFiles

Updated: Javascript library - ResumableUploadForGoogleDrive_js

ResumableUploadForGoogleDrive_js was updated to v2.0.2.

  • v2.0.2 (May 23, 2024)

    1. From this version, the files could be also uploaded to the shared drive.

CDN

Class ResumableUploadToGoogleDrive

This Class can achieve the resumable upload of a file by reading the file to the memory.

<script src="https://cdn.jsdelivr.net/gh/tanaikech/ResumableUploadForGoogleDrive_js@2.0.2/resumableupload_js.min.js"></script>

Class ResumableUploadToGoogleDrive2

This Class can achieve the resumable upload of a file by directly reading partially the file from the local Disk. By this, the large file which is over the memory of the local PC can be uploaded.

GAS Library - GeminiWithFiles

Overview

This is a Google Apps Script library for Gemini API with files.

A new Google Apps Script library called GeminiWithFiles simplifies using Gemini, a large language model, to process unstructured data like images and PDFs. GeminiWithFiles can upload files, generate content, and create descriptions from multiple images at once. This significantly reduces workload and expands possibilities for using Gemini.

Description

Recently, Gemini, a large language model from Google AI, has brought new possibilities to various tasks by enabling the use of unstructured data as structured data. This is particularly significant because a vast amount of information exists in unstructured formats like text documents, images, and videos.

Updated: GAS Library - RichTextAssistant

RichTextAssistant was updated to v1.0.1.

  • v1.0.1 (April 22, 2024)

    1. From oshliaer’s report, a bug was removed. In the current stage, when RichTextValueBuilder is used, it seems that when setTextStyle is used after setLinkUrl, the style of the hyperlink is removed while the link is kept. So, it is required to set setLinkUrl after setTextStyle.

You can see the detail information here https://github.com/tanaikech/RichTextAssistant

GAS Library - GoogleApiApp

Overview

This is a Google Apps Script library for supporting to use Google APIs with Google Apps Script.

Description

There are numerous powerful Google APIs available today. Google Apps Script streamlines interacting with these APIs through a simplified authorization process. Additionally, advanced Google services integrate seamlessly with Apps Script, making Google APIs highly advantageous for users.

However, utilizing APIs beyond advanced Google services can be challenging for some users. Developing a simpler method for using various Google APIs would significantly increase their accessibility and empower a broader range of users to create diverse applications.

GAS Library - MicrosoftDocsApp

Overview

This is a Google Apps Script library for using Microsoft Docs files (Word, Excel, and PowerPoint files) using Document service, Spreadsheet service, and Slides Service of Google Apps Script.

Description

Recently, Microsoft Docs files (Word, Excel, and PowerPoint files) could be manually edited by opening it on Google Drive using the browser. This is good news for a lot of users. With this situation, the URLs of Microsoft Docs files were changed. For example, when a Microsoft Word file (DOCX) is opened on Google Drive with the browser, the URL is https://docs.google.com/document/d/###/edit. ### of this URL is the file ID of the DOCX file on Google Drive. This URL is the same as that of Google Document while the length of the file ID is different. From this situation, it might be guessed that the Document service of Google Apps Script might be able to be used for DOCX files.

Updated: GAS Library - HtmlFormApp

HtmlFormApp was updated to v1.0.2.

  • v1.0.2 (October 17, 2023)

    1. The 2nd argument row of appendFormData(object, row) was added. This is from this suggestion. When row is used, the value is put into the specific row of the Spreadsheet. In this case, please set the value of row more than 1.

      • In this case, the submitted row can be forcefully put into the specific row of Google Spreadsheet. So, when you run appendFormData(object, row) by the constant value of row, the submitted row is put into the same row. Please be careful about this.

You can see the detail information here https://github.com/tanaikech/HtmlFormApp

GAS Library - ScriptHistoryApp

Overview

This is a Google Apps Script library for managing the histories of the Google Apps Script project.

Description

On August 23, 2023, the project history has been implemented in the new IDE of Google Apps Script. Ref and Ref In the current stage, the users can see the history of the previously deployed script version. This is a very important implementation for a lot of developers.

Here, I remember the classic IDE. In the case of the classic IDE, the users had been able to see the previously saved script version regardless of the deployment and just the save of the script. This is not implemented in the new IDE. I would like to expect that this will be implemented in the future update.

GAS Library - PDFApp

Overview

This is a Google Apps Script library for managing PDFs.

Description

Google Apps Script is one of the most powerful tools for cloud computing. When Google Apps Script is used, the result can be obtained even when the user doesn’t stay in front of the PC and mobile phone by the triggers. One day, there might be a case where it is required to manage PDF data using Google Apps Script. The combination of Google Docs (Document, Spreadsheet, and Slide) and PDFs is useful for various situations. However, unfortunately, there are no built-in methods for directly managing PDFs using Google Apps Script. Fortunately, it seems that pdf-lib of the Javascript library can be used with Google Apps Script. By this, PDF data can be managed with Google Apps Script using this library. This Google Apps Script library manages PDFs by using it as a wrapper between Google Apps Script and pdf-lib.

GAS Library - TriggerApp

Overview

This is a Google Apps Script library for efficiently managing the time-driven triggers for executing Google Apps Script using Google Apps Script.

Description

Google Apps Script can execute with not only the manual operation but also several triggers. The time-driven trigger is one of them, and this is one of a lot of important functions. When the time-driven trigger is used, Google Apps Script can be automatically executed at the time you set without launching the user’s PC.

GAS Library - TemplateApp

Overview

This is a Google Apps Script library for easily managing the template of Google Documents and Google Slides using Google Spreadsheet as a database using Google Apps Script.

Description

You might have situations where are required to create multiple Google Documents and Google Slides from the templates using Google Spreadsheet as a database with Google Apps Script. When the simple texts are replaced with the placeholders on the templates, this can be achieved by a simple script. However, there is the case that the images are required to be inserted into the templates. In this case, the script is complicated. The method for replacing the placeholders with the images is different between Google Documents and Google Slides. And, when I see questions on Stackoverflow, a lot of questions related to the template process using Google Documents and Google Slides can be seen. Furthermore, I personally have a lot of questions related to this from other users. From this situation, I thought that when managing the template process can be simply run, it will be useful for a lot of users. So, I created this library.

GAS Library - UtlApp

Overview

This is a Google Apps Script library including useful scripts for supporting to development of applications by Google Apps Script. In the current stage, the 3 categories “For array processing”, “For binary processing”, and “For string processing” are included in this library.

Description

When I create applications using Google Apps Script, there are useful scripts for often use. At that time, I thought that when those scripts can be simply used, they will be useful not only to me but also to other users. From this motivation, I created a Google Apps Script library including those scripts. But, I have been using these useful scripts only in my development before.

GAS Library - RichTextAssistant

Overview

This is a GAS library for supporting editing RichText in Google Spreadsheet using Google Apps Script.

Description

There is RichTextApp in my published libraries. RichTextApp can be used mainly for converting RichText to Google Documents and vice versa. This library RichTextAssistant will support editing the rich text in Google Spreadsheets using Google Apps Script. Google Spreadsheet can use rich text as the cell value using Google Apps Script. But, I thought that when I created a script for editing the existing rich text in the cell, it might be a bit complicated. Because, for example, in the current stage, when the text of rich text of a cell is changed using a script, all text styles are cleared. In order to add and delete a text for the rich text in a cell, it is required to create a script while the current text style is kept. This is actually complicated. From this situation, when a script for supporting editing the rich text in a cell is published, it will be useful for a lot of users. So, I created it and published it as “RichTextAssistant” of a Google Apps Script library.

Updated: GAS Library - BatchRequest

BatchRequest was updated to v1.2.1.

  • v1.2.1 (March 8, 2023)

    1. An option of exportDataAsBlob was added to the request object to the method of EDo(). Ref When this option is used, the response values from the batch requests are returned as Blob. By this, for example, when you export Google Spreadsheet as PDF data using the batch requests, the PDF data can be retrieved as Blob.

Sample script using exportDataAsBlob

In this sample, the Spreadsheet and Document files are exported as PDF format using the batch requests. The exported PDF data is created as a PDF file to the root folder. When I answered this thread on Stackoverflow, when this option is added to this library, I thought that it might be useful for users.

Updated: GAS Library - BatchRequest

BatchRequest was updated to v1.2.0.

  • v1.2.0 (September 30, 2022)

    1. A new method of getBatchPath(name, version) was added. After August 12, 2020, in order to use batch requests, the batch path is required to be used to the endpoint of the batch requests. And, the batch path is sometimes updated. So, when a constant batch path has been continued to be used, this might lead to the reason for an error. In this method, the batch path is retrieved from Discovery API. By this, the latest batch path can be always simply obtained from the name of Google API. And, the retrieved batch path can be used in Do(object) and EDo(object) methods.

You can check this at https://github.com/tanaikech/BatchRequest.

Updated: GAS Library - DocsServiceApp

Overview

This is a Google Apps Script library for supporting Document service, Docs API, Spreadsheet service, Sheets API, Slides service and Slides API. The aim of this library is to compensate the processes that they services cannot achieve.

DocsServiceApp was updated to v1.2.0

  • v1.2.0 (September 29, 2022)

    1. Added a new method of getNamedFunctions(). This method can retrieve the named functions from Google Spreadsheet.

You can see the detail information here https://github.com/tanaikech/DocsServiceApp

Updated: GAS Library - DocsServiceApp

Overview

This is a Google Apps Script library for supporting Document service, Docs API, Spreadsheet service, Sheets API, Slides service and Slides API. The aim of this library is to compensate the processes that they services cannot achieve.

DocsServiceApp was updated to v1.1.0

  • v1.1.0 (September 28, 2022)

    1. Added a new method of getQuotePrefixCells(). This method can detect the cells with the quote prefix cells.

You can see the detail information here https://github.com/tanaikech/DocsServiceApp

Report: Efficiently Creating Web Apps using a Google Apps Script library

Gists

This is a sample script for efficiently creating Web Apps using a Google Apps Script library.

When a Google Apps Script library is used for creating Web Apps, the following advantage can be obtained.

  • The script of the client-side can be simpler. Because most scripts for constructing Web Apps are included in the Google Apps Script library.
  • When the script of Web Apps (In this case, the script of Google Apps Script library is modified.) is modified, the latest script is reflected in the Web Apps, immediately. Because when the Google Apps Script library is used as the latest version when the script of the library is modified, the client can use the latest script of the library, immediately. So, the downtime of Web Apps can be reduced.
    • By this, it is not required to manually reflect the latest version of the script to the Web Apps.
  • When you can change the script of Web Apps by changing the deployed version of the library.

The sample script for explaining this is as follows.

Javascript library - CropImageByBorder_js

Javascript Library for Cropping Image by Border

Overview

This is a Javascript library for cropping images by the border.

Description

When an image is used, there is a case where I wanted to simply crop the image by a script. In this Javascript library, the image is cropped by a border. The sample situation is as follows.

In this sample situation, a red rectangle is enclosed by a border (1 pixel) with “#000000”. By this border, this library crops the red rectangle. In this case, the 1-pixel border is not included in the resulting image.

GAS Library - DocNamedRangeApp

Overview

This is a Google Apps Script library for managing the named range on Google Documents.

Description

Google Document can use the named range. When the named range is used, the users can directly access the contents using the named range. For example, the developer can guide the users to the specific content in Google Documents using the named range. But, unfortunately, in the current stage, it seems that the named range cannot be directly used by the UI on Google Documents. It is required to use Google Apps Script. But, I thought that when I saw the official document of the named range, it might be difficult to understand it. Ref So, I created this library. When this library is used, the named ranges on Google Documents can be managed.

Updated: Go Library - go-getfilelist to v200

go-getfilelist was updated to v2.0.0

  • v2.0.0 (February 25, 2022)

    1. By changing the specification of methods, drive.New() and transport.APIKey were deprecated. By this, I updated the specification of this library as the version 2. When you are required to continue to use drive.New() and transport.APIKey, you can use them with the version 1. At version 1, *http.Client is given to this library. From version 2, *drive.Service is given instead of *http.Client. Please be careful this. You can see the sample script at the above.

You can get this from https://github.com/tanaikech/go-getfilelist

GAS Library - HtmlFormApp

Overview

This is a Google Apps Script library for parsing the form object from HTML form and appending the submitted values to the Spreadsheet.

Description

There is Google Form in the Google service. Google Form can parse the submitted data and put it in the Spreadsheet. But when we want to use the custom form, it is required to use the HTML form on Web Apps, dialog, and sidebar. In this case, it is required to prepare Javascript and Google Apps Script for parsing the form object from the HTML form and appending the parsed values to Spreadsheet. Recently, a bug of the built-in parser from the Javascript side to the Google Apps Script side for parsing the form object from the HTML form had been removed. Ref But, in the current stage, this bug is removed for only Web Apps. Unfortunately, for the dialog and sidebar, this bug has never been removed. And also, unfortunately, the built-in parser from the Javascript side to the Google Apps Script side cannot be used for the multiple files of the input tag. And, this cannot be used except for google.script.run. For example, when the HTML form including the files is submitted using “action” of the form tag, the file content is not included. And then, when the form object is retrieved, it is required to parse the object and put it in the Spreadsheet. From these situations, I thought that when this process can be run using the libraries, that might be useful for users. So I created this.

Update: Javascript library - HtmlFormObjectParserForGoogleAppsScript_js

This is a Javascript library for sending the HTML form object to Google Apps Script using google.script.run.

HtmlFormObjectParserForGoogleAppsScript_js was updated to v1.0.1.

  • v1.0.1 (January 11, 2022)

    1. A new argument of includeOrder was added as the 4th argument. This library returns the parsed form object as a JSON object. By this, the order of HTML form object is not saved. From this version, this order can be included. This argument includes the order of each input tag in form. The default value is false. When this value is true, a property of orderOfFormObject is included in the returned object. This value is the order of HTML form object. Using this value, you can retrieve the parsed form object in order of HTML form.

You can see the detail of this at https://github.com/tanaikech/HtmlFormObjectParserForGoogleAppsScript_js

Updated: Javascript library - ResumableUploadForGoogleDrive_js

ResumableUploadForGoogleDrive_js was updated to v2.0.0.

  • v2.0.0 (November 15, 2021)

    1. New Class ResumableUploadToGoogleDrive2 was added. By this, the large file which is over the memory in the local PC can be uploaded by the resumable upload.

Overview

This is a Javascript library to achieve the resumable upload for Google Drive.

Description

When a file more than 5 MB is uploaded to Google Drive with Drive API, the resumable upload is required to be used. I have already published the sample script for “Resumable Upload for Web Apps using Google Apps Script”. Ref In this case, Web Apps is used. Here, I would like to introduce the script for the resumable upload created by only Javascript. Unfortunately, in the current stage, at google-api-javascript-client, there are no methods for the resumable upload. And, I thought that when this function is created as a Javascript library, it might be useful for users. Also that library is also useful for me. So I created this. If this was useful for your situation, I’m glad.

Updated: GAS Library - RichTextApp

RichTextApp was updated to v1.3.0

  • v1.3.0 (October 20, 2021)

    1. Added a new method of RangeToHTMLTableForSpreadsheet. In this method, the range on Google Spreadsheet is converted to a HTML table. Using this method, for example, you can send the specific range in the Spreadsheet as an email by including a HTML table.

You can see the detail information here https://github.com/tanaikech/RichTextApp

Sending Outlook Emails using Microsoft Account with Google Apps Script

Gists

This is a sample script for sending Outlook emails using Microsoft account with Google Apps Script.

Before you use this script, please install OnedriveApp which is Google Apps Script library. Ref And, please authorize your Microsoft account for using Microsoft Graph API. Ref

Sample script

function myFunction() {
  const obj = [
    {
      to: [{ name: "### name ###", email: "### email address ###" }, , ,],
      subject: "sample subject 1",
      body: "sample text body",
      cc: [{ name: "name1", email: "emailaddress1" }, , ,],
    },
    {
      to: [{ name: "### name ###", email: "### email address ###" }, , ,],
      subject: "sample subject 2",
      htmlBody: "<u><b>sample html body</b></u>",
      attachments: [blob],
      bcc: [{ name: "name1", email: "emailaddress1" }, , ,],
    },
  ];

  const prop = PropertiesService.getScriptProperties();
  const odapp = OnedriveApp.init(prop);
  const res = odapp.sendEmails(obj);
  console.log(res);
}

In this sample script, 2 emails are sent using Microsoft Graph API with your Microsoft account. By this, both Outlook Emails and Google Emails can be used by Google Apps Script.

Retrieving List of All Emails of Microsoft Account using Google Apps Script

Gists

This is a sample script for retrieving the list of all emails of Microsoft account and putting them to Google Spreadsheet using Google Apps Script.

I updated OnedriveApp to v1.2.0 by adding 1 method for retrieving the access token and 7 methods for managing emails of Microsoft account. By this, the emails got to be able to be gotten and sent using Microsoft account using OnedriveApp with Google Apps Script.

Javascript library - GetAccessTokenFromServiceAccount_js

Overview

This is a Javascript library to retrieve the access token from the Google Service Account. Ref

Description

I have already posted the sample script for retrieving the access token from the Google Service Account. Ref But, when I use this script, I thought that when this was published as the Javascript library, it will be useful. So I created this.

Install

<script src="getaccesstokengromserviceaccount_js.min.js"></script>

Or, using jsdelivr cdn

<script src="https://cdn.jsdelivr.net/gh/tanaikech/GetAccessTokenFromServiceAccount_js@master/getaccesstokengromserviceaccount_js.min.js"></script>

You can see the detail of this at https://github.com/tanaikech/GetAccessTokenFromServiceAccount_js

Javascript library - HtmlFormObjectParserForGoogleAppsScript_js

Parser for Sending HTML Form Object to Google Apps Script using google.script.run

Overview

This is a Javascript library for sending the HTML form object to Google Apps Script using google.script.run.

Description

HTML form object is parsed by this library, and the object can be sent to Google Apps Script using google.script.run. After the V8 runtime got to be able to be used for Google Apps Script, when the file input tag is included in the HTML form object, the object sent to Google Apps Script using google.script.run cannot be directly used. Because it seems that the binary file data cannot be parsed when it is sent with google.script.run. Ref In the current stage, as the workaround, the file data is required to be sent to Google Apps Script using google.script.run after it was converted to the byte array and the base64 data. I think that this might be resolved in the future update. But I thought that as the current workaround, when the parser for converting this is prepared, it might be useful for users, because I saw the several questions which have this issue at Stackoverflow.

Javascript library - BatchRequest_js

Overview

This is a library for running Batch Requests for Google APIs using Javascript.

Description

When users use Google’s APIs, one quota is used for one API call. When the batch request is used, several APIs can be called by one quota, although there are some limitations in the batch request.

google-api-javascript-client can run the batch request. Ref But, I created this for my self study. This library can achieve the batch request using fetch without using google-api-javascript-client.

GAS Library - DocsServiceApp

Overview

This is a Google Apps Script library for supporting Document service, Docs API, Spreadsheet service, Sheets API, Slides service and Slides API. The aim of this library is to compensate the processes that they services cannot achieve.

Description

The Google services, which are Document service, Docs API, Spreadsheet service, Sheets API, Slides service and Slides API, are growing now. But, unfortunately, there are still the processes that they cannot done. I created this GAS library for supporting the Google services.

GAS Library - GASProjectApp

Overview

This is a Google Apps Script library for creating, updating and exporting Google Apps Script project of the standalone type using Drive API. In this case, Apps Script API is not used.

Description

I had reported “Drive API cannot create Google Apps Script project no longer” before. Ref About this, I had reported the future request. Ref At July 30, 2020, I could confirm that the Google Apps Script project of the standalone type got to be able to be created by multipart/form-data using Drive API again. Ref This is a good news for me. By this, in order to use this with Google Apps Script, I created this library. Because in this case, when the update method is used, the special scope of https://www.googleapis.com/auth/drive.scripts is required. So I thought that when this is published as the Google Apps Script library, this will be useful for users.

GAS Library - OwnershipTransfer

Overview

This is a Google Apps Script library for achieving the ownership-transfer of the specific folder including the files and sub-folders using Drive API.

IMPORTANT: PLEASE BE CAREFUL THIS.

At first, please read this section

I cannot take responsibility for the problems occurred by this library. So when you use this library, please use it by according to your own decision and at your own responsibility.

This GAS library transfers the ownership of files and folders. For example, when the ownership of a file is transferred to other account, the file cannot be managed by the original user. And also, when the ownership of the specific folder is transferred to other account, all files ans sub-folders in the specific folder cannot be managed by the original user. PLEASE BE CAREFUL THIS. So when you use this library, at first, please test this library using a sample file and folder. PLEASE BE CAREFUL THIS.

And also, the specification of ownership transfer might be updated by Google side in the future update. Because when I had tested this library, I could notice that the specification had been changed. Ref By this, I noticed that the transferred files had no parent folders, and also, the script was required to be modified. From this situation, when you use this script for your important files and folders, please be careful this. At first, PLEASE TEST THIS LIBRARY USING A SIMPLE FILE AND FOLDER.

Description

Recently, I had the situation that it is required to transfer the ownership of a folder including the files and sub-folders. When I manually transferred the ownership of the top folder from my account to other user’s account, although the ownership of top folder could be transferred, my account is left as the writer. And also, the ownership of the files and sub-folders in the top folder was not changed, while the user is the writer. Although I do the same situation using the method of create.permissions in Drive API, the same result was obtained. In the current stage, unfortunately, by the simple method, the complete ownership-transfer of the file including the files and sub-folders cannot be achieved. From this situation, I created the script for achieving the complete ownership-transfer of the files and folders as a Google Apps Script library.

Updated: GAS Library - RichTextApp

RichTextApp was updated to v1.1.2

  • v1.1.0 (June 16, 2020)

    1. Add new method of RichTextToHTMLForSpreadsheet. The method of RichTextToHTMLForSpreadsheet can convert the rich texts in the cells to the HTML format.
  • v1.1.1 (June 16, 2020)

    1. About the method of RichTextToHTMLForSpreadsheet, I forgot to convert hyperlinks to HTML. This was modified.
  • v1.1.2 (June 16, 2020)

    1. When one row and several columns are used as the range, only 1st column is returned. This bug was removed.

You can see the detail information here https://github.com/tanaikech/RichTextApp

Updated: GAS Library - BatchRequest

BatchRequest was updated to v1.1.0.

  • v1.1.0 (June 10, 2020)

    1. New method of EDo() was added. This method is the enhanced Do() method. When this method is used, the result values from the batch requests are parsed. And also, the number of requests more than 100 can be used. In this case, the split of the number of requests is processed for the limitation of 100.

You can check this at https://github.com/tanaikech/BatchRequest.

GAS Library - CopyFolder

Overview

This is Google Apps Script library for copying folder on Google Drive.

Description

I have sometimes the situation that it is required to back up the folder on Google Drive to Google Drive. But unfortunately, the method of makeCopy() of Class File and the method of Files: copy of Drive API cannot be used for directly copying the folder on Google Drive. So I created this as a library. This library can copy the folder on Google Drive. All files in the folder can be copied to Google Drive with keeping the folder structure. When there are the files with newer modified time in the source folder than those in the destination folder, the files in the destination folder are overwritten by the newer files in the source folder. Also, in this library, the folders in the shared Drive and the publicly shared folders can be used as the source and destination folder.

Updated: Javascript library - GetFileList_js

GetFileList_js was updated to v1.0.2.

  • v1.0.2 (May 15, 2020)

    1. Shared drive got to be able to be used. The file list can be retrieved from both your Google Drive and the shared drive.

      • For example, when the folder ID in the shared Drive is used id of resource, you can retrieve the file list from the folder in the shared Drive.

You can see the detail information here https://github.com/tanaikech/GetFileList_js

Updated: python library - getfilelistpy

python library - getfilelistpy was updated to v1.0.5.

  • v1.0.5 (May 15, 2020)

    1. Shared drive got to be able to be used. The file list can be retrieved from both your Google Drive and the shared drive.

      • For example, when the folder ID in the shared Drive is used id of resource, you can retrieve the file list from the folder in the shared Drive.

You can check getfilelistpy at https://github.com/tanaikech/getfilelistpy.

You can also check getfilelistpy at https://pypi.org/project/getfilelistpy/.

Updated: Go Library - go-getfilelist to v103

go-getfilelist was updated to v1.0.3

  • v1.0.3 (May 14, 2020)

    1. Shared drive got to be able to be used. The file list can be retrieved from both your Google Drive and the shared drive.

      • For example, when the folder ID in the shared Drive is used folderID of Folder(folderID), you can retrieve the file list from the folder in the shared Drive.

You can get this from https://github.com/tanaikech/go-getfilelist

Updated: GAS Library - FilesApp

FilesApp was updated to v1.1.0.

  1. Shared drive got to be able to be used. From the version 1.1.0, the following modification was added.
    1. V8 is used.
    2. As the default setting, the file list is retrieved from both your Google Drive and the shared drive.
      • By this, for example, when the folder ID in the shared Drive is used to ### of const res = FilesApp.createTree("###"), the folder tree of the shared Drive is retrieved, if you have the shared Drive.

And also, FilesApp was updated to v1.1.1.

GAS Library - GPhotoApp

Overview

This is a GAS library for retrieving and creating the albums and media items using Google Photo API using Google Apps Script (GAS).

Description

In the current stage, Google Photo API is not included in Advanced Google services. But in order to use Google Photo API with Google Apps Script, I created this as a GAS library. So in the current stage, in order to use this library, the following flow is required.

GAS Library - RichTextApp

Overview

This is a GAS library for copying the rich text with the text styles from Google Document to Google Spreadsheet or from Google Spreadsheet to Google Document using Google Apps Script (GAS).

Description

Google Spreadsheet can use the rich text as the cell value. But I thought that it is difficult for me to directly edit the rich text in a cell. So I wanted to copy the rich text, that I edited at the Google Document, to the cell of Google Spreadsheet. But, unfortunately, when the rich text in Google Document is manually copied to a cell in Google Spreadsheet, the text style is removed. By this, only text values are copied. It seemed that this was the current specification. So in order to achieve above, I created this as a library.

Google Apps Script Library Database and Search Application

Overview

This is for the Google Apps Script Library Database.

Description

Since Google Apps Script was released on August 19th, 2009, it is used by a lot of users. Ref1, Ref2 By this, now there are a lot of useful libraries of Google Apps Script (GAS) in all over the world. But when I want to search a GAS library, I always use Google search engine. Unfortunately, in the current stage, the libraries cannot be directly searched by a database. On January 11th, 2020, a proposal for the database of Google Apps Script Library has been proposed by Andrew Roberts. Ref3 When I have discussing about this with him, I thought that I tried to think of a sample database. So I prepared this.

Updated: GAS Library - ManifestsApp

ManifestsApp was updated to v1.0.4.

  • v1.0.4 (February 12, 2020)

    • “runtimeVersion” got to be able to be got and set. Now, ‘STABLE’, ‘V8’, ‘DEPRECATED_ES5’ can be used as the value of “runtimeVersion”. For example, you can enable V8 with the following script.

      var r = ManifestsApp.setProjectId(projectId).setRuntimeVersion("V8");
      Logger.log(r);
      
    • As one important point, when “STABLE” and “DEPRECATED_ES5” are used for the Google Apps Script project created before 2020 as the value of “runtimeVersion”, the error of Syntax error: Illegal character. occurs. So please be careful this. This has been reported at the issuetracker.

GAS Library - DateFinder

Overview

DateFinder is a GAS library for searching the date objects from the cell range on the sheet in the Spreadsheet and retrieving the searched range as the RangeList object using Google Apps Script (GAS).

Description

There is the Class TextFinder for searching the text from cells of the Spreadsheet using the Google Apps Script. But in this case, the date object in the cell is used as the string. Namely, the values for searching are used as the same with the values retrieved by getDisplayValues(). So for example, when there are the date objects in the cells with the various formats, the date cannot be searched by the Class TextFinder. So I created this library. When this library is used, the date objects in the cells can be retrieved by the date object and/or the range between 2 dates.

Libraries of gdoctableapp for golang, Node.js and python were updated to v110

Libraries of gdoctableapp for golang, Node.js and python were updated to v1.1.0

Libraries of gdoctableapp for golang, Node.js and python were updated to v105

Libraries of gdoctableapp for golang, Node.js and python were updated to v1.0.5

Update History

  • v1.0.5 (January 21, 2020)

    • When the inline objects and tables are put in the table. An error occurred. This bug was removed by this update.
  • I got the pull request at here.

GAS Library - GmailToList

Overview

This is a library for exporting all messages of Gmail as a list using Google Apps Script (GAS).

Description

Recently, I have had a situation it had been required to backup all messages in own Gmail. In order to achieve this, I created a simple script. After I created it, I thought that when such situation might occur for other users and the script is published as a library, they might be useful. So I created this library. But I created this for my situation. So if this cannot be used for your environment and an error occurs, I apologize.

Javascript library - ResumableUploadForGoogleDrive_js

Overview

This is a Javascript library to achieve the resumable upload for Google Drive.

Description

When a file more than 5 MB is uploaded to Google Drive with Drive API, the resumable upload is required to be used. I have already published the sample script for “Resumable Upload for Web Apps using Google Apps Script”. Ref In this case, Web Apps is used. Here, I would like to introduce the script for the resumable upload created by only Javascript. Unfortunately, in the current stage, at google-api-javascript-client, there are no methods for the resumable upload. And, I thought that when this function is created as a Javascript library, it might be useful for users. Also that library is also useful for me. So I created this. If this was useful for your situation, I’m glad.

Javascript library - syncGoogleScriptRun

Overview

This is a Javascript library to use “google.script.run” with the synchronous process.

Description

When I create Web Apps, add-on using a side bar and dialog, there is the case that I want to use google.script.run with the synchronous process. As you know, google.script.run works with the asynchronous process. So in order to use it as the synchronous process, the script is required to be prepared. I also saw several issues for such situation at Stackoverflow and other sites. I thought that when the script for achieving this was prepared as a library, it might be useful for users. So I created this.

Javascript library - GetFileList_js

Overview

This is a Javascript library to retrieve the file list with the folder tree from the specific folder (publicly shared folders and own folders) of Google Drive.

Description

The library for retrieving the file list with the folder tree from the specific folder of Google Drive has already been published for Google Apps Script, golang, node.js and python as GetFileList. Ref Here, this GetFileList was released as the library of Javascript.

Updated: python library - getfilelistpy

python library - getfilelistpy was updated to v1.0.4.

  • v1.0.4 (August 23, 2019)

    1. For OAuth2, oauth2client and google_auth_oauthlib got to be able to be used. About the sample script for google_auth_oauthlib, please see this.

You can check getfilelistpy at https://github.com/tanaikech/getfilelistpy.

You can also check getfilelistpy at https://pypi.org/project/getfilelistpy/.

GAS Library - UnzipGs

Overview

This is a GAS library for unzipping a Zip file protected by a password using Google Apps Script.

Description

Recently, I had a situation that it is required to unzip a Zip file protected with the password. But unfortunately, in the current stage, the method of Utilities.unzip() cannot unzip such protected files. So when I had been looking for the other workarounds, I found zlib.js. Especially, it’s unzip.min.js. This is created for Javascript. So when I used this using Google Apps Script, it was found that it didn’t work for Google Apps Script. So I prepared a wrapper script for running it with Google Apps Script. And when I created the wrapper script, I thought that under the current stage, if the protected Zip file can be unzipped, this will be useful for other users. So I created this as a GAS library.

python library - gdoctableapppy

Overview

This is a python library to manage the tables on Google Document using Google Docs API.

Description

Google Docs API has been released. When I used this API, I found that it is very difficult for me to manage the tables on Google Document using Google Docs API. Although I checked the official document, unfortunately, I thought that it’s very difficult for me. So in order to easily manage the tables on Google Document, I created this library.

Go Library - go-gdoctableapp

Overview

This is a Golang library for managing tables on Google Document using Google Docs API.

Description

Google Docs API has been released. When I used this API, I found that it is very difficult for me to manage the tables on Google Document using Google Docs API. Although I checked the official document, unfortunately, I thought that it’s very difficult for me. So in order to easily manage the tables on Google Document, I created this library.

GAS Library - GetEditType

Overview

GetEditType is a GAS library for retrieving the edit types of the OnEdit event trigger of Spreadsheet using Google Apps Script (GAS).

Description

In the case that the OnEdit event trigger (simple and installable triggers) is used at Spreadsheet, when users manually edited the cell of Spreadsheet, the trigger is fired. At this time, there is the case that I want to know the edit type. For example, I would like to know about the following edit types.

Go Library - go-fetchall

Overview

This is a Golang library for running HTTP requests with the asynchronous process. The progress of requests can be also shown.

Demo

In this demonstration, 5 requests are run by 2 workers. And before each request, the waiting time for 2 seconds is added as a sample. By this, you can easily see the work with 2 workers. Also you can see this script at the following sample script.

GAS Library - FetchApp

Overview

This is a GAS library for creating and requesting the type of multipart/form-data using Google Apps Script. This library enhances Class UelFetchApp of Google Apps Script.

Description

In order to fetch data from URL, there is Class UrlFetchApp in Google Apps Script. As the method for fetching, there is the method of fetch(url, params). In the current stage which was released this library, when user want to request with the type of multipart/form-data, the request body is required to be created by the user. But it is a bit difficult to create the request body. I thought that if the request body for the type of multipart/form-data can be easily created, it might be also useful for other users. So I created this as a GAS library.

GAS Library - GistChecker

Overview

This is a GAS library for notifying the change of number of comments, stars and forks of own Gists as an email using Google Apps Script.

Description

Recently, I noticed that when a comment was posted to own Gists, and the numbers of stars and forks of own Gists were changed, the notification mail is not sent. Also I knew that in the current stage, there are no official methods for notifying them, yet. For this situation, I thought an application for notifying them as an email can be created using Google Apps Script, and when such application can be easily to be used, it may be useful for other users. So I created this as a GAS library.

GAS Library - ProcessApp

Overview

This is a library for retrieving the process and information of Google Apps Script.

Methods

  1. getExecutionTimeOfTrigger() : This method retrieves the total execution time of all functions executed by the time-driven trigger at owner’s account. For example, you can know the total execution time of all functions executed by the time-driven trigger in 24 h.
  2. getDevUrl() : This method retrieves the endpoint of developer mode for Web Apps like https://script.google.com/macros/s/#####/dev.
  3. getRunningFunctions() : This method retrieves the functions which are running now.

You can check this at https://github.com/tanaikech/ProcessApp.

Retrieving file list with folder structure under a specific folder in Google Drive

Gists

When I create applications for using Google Drive, I often retrieve a file list from a folder in the application. So far, I had created the script for retrieving a file list from a folder for each application. Recently, I thought that if there is the script for retrieving the file list with the folder tree from the folder of Google Drive as a library, it will be useful for me and other users. So I created them.

python library - getfilelistpy

Overview

This is a python library to retrieve the file list with the folder tree from the specific folder of Google Drive.

Description

When I create applications for using Google Drive, I often retrieve a file list from a folder in the application. So far, I had created the script for retrieving a file list from a folder for each application. Recently, I thought that if there is the script for retrieving the file list with the folder tree from the folder of Google Drive as a library, it will be useful for me and other users. So I created this.

Updated: Go Library - go-getfilelist to v101

go-getfilelist was updated to v1.0.1

  • v1.0.1 (November 13, 2018)

    1. From this version, in order to retrieve files and file information, “google.golang.org/api/drive/v3” is used.
      • By this, when the values are retrieved from this library, users can use the structure of drive.File.
      • Script using this library can be seen at goodls.

You can get this from https://github.com/tanaikech/go-getfilelist

Go Library - go-getfilelist

Overview

This is a Golang library to retrieve the file list with the folder tree from the specific folder of Google Drive.

Description

When I create applications for using Google Drive, I often retrieve a file list from a folder in the application. So far, I had created the script for retrieving a file list from a folder for each application. Recently, I thought that if there is the script for retrieving the file list with the folder tree from the folder of Google Drive as a library, it will be useful for me and other users. So I created this.

GAS Library - ArrangeStackingOrder

Overview

ArrangeStackingOrder is a GAS library for arranging the stacking order of page elements on Google Slides using Google Apps Script (GAS).

Demo

This is a demonstration of this library when this is used as a Google Slides Addon.

Description

Do you have situations that you want to arrange the stacking order of page elements on Google Slides using GAS? I had it before. At that time, I could achieve it by creating a simple script. Recently, I found that users who have the same situation. I thought that if there is a library for this, it will be useful for me and other developers. So I created this. If this was useful for your situation, I’m glad.

GAS Library - DownloadLargeFilesByUrl

Overview

DownloadLargeFilesByUrl is a GAS library for downloading large files from URL to Google Drive using Google Apps Script (GAS).

Description

I had been thinking of about whether a large file from an URL can be downloaded to Google Drive using GAS. When I have tried to download such large files, I noticed the following limitations. These limitations are due to the specification of GAS.

  • When users download a file from URL using GAS, at the most users, it retrieves the blob using UrlFetchApp.fetch(url).getBlob() and saves it as a file using DriveApp.createFile(blob). In this case, only files less than 50 MB (52,428,800 bytes) can be created, because of the size limitation of Blob.
  • There are a limit executing time for Google Apps Script (GAS). That is 6 min/execution.
  • There are a limit of total executing time for running scripts by triggers. That is 90 min/day. (Recently, it became from 60 min/day to 90 min/day.)

When it tries to create the application for downloading the large files, it is required to consider above limitations. On the other hand, there are the following relaxations of quotas by the recent Google’s update.

GAS Library - RangeListApp

Overview

RangeListApp is a GAS library for retrieving, putting and replacing values for Spreadsheet by a range list with a1Notation using Google Apps Script (GAS).

Description

There is Class RangeList as one of classes for Spreadsheet. There is setValue(value) in Class RangeList as a method. setValue(value) puts value to the cells of range list. Recently, when I used this method, I noticed that the following situations what I want cannot be achieved.

Updated: GAS Library - ManifestsApp

ManifestsApp was updated to v1.0.3.

  • v1.0.3 (July 11, 2018)

    • By Google’s update, “sheets” was added to manifests for installing the configuration of Macro. By this, this library was updated.
      • You can see the added methods (getSheets(), setSheets()) at Usage.
      • If you set “sheets”, please put the value of “sheets” as the resource like below sample.
        • {"macros": [{"menuName": "QuickRowSum", "functionName": "calculateRowSum"}]}
        • Don’t put {"sheets": {"macros": [{"menuName": "QuickRowSum", "functionName": "calculateRowSum"}]}}

You can check this at https://github.com/tanaikech/ManifestsApp.

GAS Library - FilesApp

Overview

FilesApp is a GAS library for retrieving file and folder list in Google Drive using Google Apps Script (GAS). Also this can create a tree from all files and folders in Google Drive.

Description

When I create some applications using Google Drive, there are often the case which is required to retrieve the file list and folder list. I had prepared the script each time for each case so far. But recently, I thought that if there is a library for retrieving the file and folder list (as a tree), it will be useful for me and other developers. So I created this. If this was useful for your situation, I’m glad.

GAS Library - BatchRequest

Overview

This is a library for running Batch Requests using Google Apps Script (GAS).

Description

When users use Google’s APIs, one quota is used for one API call. When the batch request is used, several APIs can be called by one quota, although there are some limitations in the batch request. For example, in GAS, Drive API can be used be DriveApp. In this case, the quota is not used for using Drive API. (When Drive of Advanced Google Services is used, the quota is used.) But this is Drive API v2. If users want to use Drive API v3, it is required to directly request each endpoint of Drive API v3. The batch request is much useful for this situation. However, it is a bit difficult for users to use the batch request. Because the batch request is requested by multipart/mixed. I thought that the script may become a bit complicated, because of the request of multipart/mixed using UrlFetchApp. And although I had been looking for the libraries for the batch request, I couldn’t find them. So I created this.

GAS Library - RunAll

Overview

This is a library for running the concurrent processing using only native Google Apps Script (GAS).

Description

Have you ever thought about the concurrent processing using only native Google Apps Script (GAS)? So far, I had run the concurrent processing using golang, javascript and python. But the script cannot be used by the trigger event, because these are not native GAS. Recently, it was found that the fetchAll method added by the Google’s update at January 19, 2018 is worked by the asynchronous processing. By this, the concurrent processing using the native GAS got to be able to be achieved. This library makes users work the concurrent processing of functions using the fetchAll method and the execution API. This can drastically reduce the process cost in the script. And also this can be used under the trigger event. So it is considered that it will be useful for both the limit executing time of 6 minutes for GAS and the limit total executing time of 1 hour/day for the trigger event.

Updated: GAS Library - ManifestsApp

ManifestsApp was updated to v1.0.2.

  • v1.0.2 (January 29, 2018)

    • ProjectApp2 is published, and got to be able to use both standalone script type and container-bound script type.
      • By this, this library also got to be able to be used for the both projects.
    • For this update, please enable Apps Script API.

You can check this at https://github.com/tanaikech/ManifestsApp.

GAS Library - ProjectApp2

Overview

This is a GAS project library for Google Apps Script (GAS). This library can be used for the projects of both standalone script type and container-bound script type.

Description

There are Class SpreadsheetApp and Class DocumentApp for operating spreadsheet and document, respectively. But there is no Class for operating GAS project. If there is such Class ProjectApp, GAS project can be directly operated by GAS script. I thought that this will lead to new applications, and created ProjectApp. On the other hand, as a CLI tool for operating GAS project, there has already been ggsrun.

Taking Advantage of Manifests by GAS Library

Gists

Introduction

By recent Google update (Google update at October 24, 2017), various new winds to GAS developers were blown. There is “Manifests” as one of the new winds. “Manifests” makes us manage the project using JSON. Especially, the special scopes which have to use OAuth2 process can be used by only setting them to the Manifests. I think that this is the largest modification. However, when scopes are added to a project using Manifests, users who use the project can use only added scopes. This means that when users create scripts in the project, if there are some scopes which is required to be added, such scopes cannot be automatically added. So the error of “Insufficient Permission” occurs.

GAS Library - RearrangeScripts

Overview

This is a GAS application for rearranging Google Apps Scripts (GAS) in a project which can be seen at the script editor.

Description

Have you ever thought about rearranging Google Apps Scripts in a project which can be seen at the script editor? I also have thought about it. Finally, I could find the workaround to do it. And recently, I have given this function to ggsrun which is a CLI tool. Furthermore, I thought that if there is a GUI application for rearranging scripts in a project, it may be useful for more users. So I created this. Today, I published this as a GUI tool using Google Apps Script. If this was useful for you, I’m glad.

GAS Library - ZipFolder

Overview

This is a library for zipping a folder using Google Apps Scripts.

Description

When users manually download a folder on Google Drive, users can download all files in the folder as a zip file using the web interface. There are zip tools in Class Utilities of Google Apps Script. However, the zip tools cannot create a zip file from a folder. And it cannot retrieve all files included any folders in a folder. So I created this. This library works like almost the same to the web interface using GAS.

GAS Library - ManifestsApp

Overview

This is a Manifests library for Google Apps Scripts.

Description

By recent update of Google, Manifests was added to Google Apps Script Project. At the moment I saw the detail, I thought that this Manifests will blow a new wind for a lot of GAS developers. So I created this.

This library makes users easily access Manifests using Google Apps Script. If this was useful for you, I’m glad.

GAS Library - ProjectApp

Overview

This is a GAS project library for Google Apps Script (GAS).

Description

There are Class SpreadsheetApp and Class DocumentApp for operating spreadsheet and document, respectively. But there is no Class for operating GAS project. If there is the Class ProjectApp, GAS project can be directly operated by GAS script. I thought that this will lead to new applications, and created ProjectApp.

On the other hand, as a CLI tool for operating GAS project, there has already been ggsrun.

Updated: GAS Library - ImgApp

ImgApp was updated to v1.2.0. New method was added.

3. updateThumbnail()

Overview

This method is for updating thumbnail of files on Google Drive using images you selected.

Description

For example, zip files don’t have the thumbnail on Google Drive. An icon is shown as the thumbnail. For the most files, Google Drive can create automatically each thumbnail. But there are sometimes files which cannot be created the thumbnail. Zip file is also one of them. In order to add and update thumbnails to such files, I added this method.

GAS Library - OnedriveApp

This is a library of Google Apps Script for using Microsoft OneDrive.

Feature

This library can carry out following functions using OneDrive APIs.

  1. Retrieve file list on OneDrive.
  2. Delete files and folders on OneDrive.
  3. Create folder on OneDrive.
  4. Download files from OneDrive to Google Drive.
  5. Upload files from Google Drive to OneDrive.

Demo

You can see the detail information here https://github.com/tanaikech/OnedriveApp

Updated: GAS Library - ImgApp

ImgApp was updated to v1.1.0. New method was added.

2. doResize()

Overview

This method is for resizing images.

Description

Unfortunately, there are no methods to resize images at Google Apps Script. As a workaround, there is a method that it imports the image in Google Document and resizes the image using setWidth() and setHeight(). But in this method, the resized blob cannot be retrieved. So although I had thought of other workaround, I had not been able to find it. Recently, I accidentally discovered the other workaround doResize(). Since it was found that this workaround can be surely used, I added this to ImgApp.

GAS Library - ImgApp - getSize()

1. getSize()

Overview

This method is for retrieving the width and height of image as the unit of pixel.

Description

Unfortunately, there are no methods to directly retrieve the image size at Google Apps Script. As a workaround, there is a method that it imports the image in Google Document and retrieves the size using getWidth() and getHeight(). But in this method, it uses much time and resources on Google. So I thought of retrieving the information of image at the binary level, and created this. By this, the low process cost could be achieved.

Go Library - getcode

Overview

This is a Golang library to automatically get an authorization code for retrieving access token using OAuth2.

Description

When it retrieves an access token and refresh token using OAuth2, the code for retrieving them has to be got by authorization on own browser. In order to retrieve the code, in generally, users have to click the authorization button and copy the code on the browser. This library can be automatically got the code by launching HTML server as a redirected server. At first, I have used this for retrieving the code from Google. But recently I noticed that this can be used for other sites. They are Google, GitHub, Slack and so on. This library can be used for creating such applications.

Updated: GAS Library - SOUWA

SOUWA means summing in Japanese. SOUWA can sum string elements in an array at the high speed. The speed of SOUWA with the pyramid algorithm is about 380 times faster than that of the standard method. New algorithm for summing array elements was developed for SOUWA. You can see the detailed report of this library at here. If you are interested in this, I’m glad.

It was updated to v1.0.2. Please check it out. https://github.com/tanaikech/SOUWA_GAS

GAS Library - CreateImg

Recently, I had been looking for creating an image from coordinate data. Unfortunately I have never found them. So I made this. This Google Apps Script (GAS) library creates an image file from coordinate data.

You can see the detail information at https://github.com/tanaikech/CreateImg.

There is a part where I would like to improve in this library. That’s convByteSlice(). I think that there is the method to be faster about the part. If you know much about the logical operation using GAS, if you teach me about the improvements. I’m so glad.

Python Library - souwapy

This “souwapy” is a library for summing array elements with high speed by new algorithm (Pyramid method). The speed is faster than csv and panbdas module of python and v8 engine of node.js. The souwapy module is 2.3 and 3.1 times faster than csv and pandas module, respectively. This was really surprised me. It was found that the theory was correct.

At first, I have created this theory for Google Apps Script. But recently I had to use large data and output a csv file on python. So I made this library. Additionally, I had wanted to know how to public own library to PyPI before. This chance was good for me. If this library is helpful for other people, I’m glad.