Google Apps Script

Retrieving Cell Coordinates of Cells with Quote Prefix using Google Apps Script (Single Quote)

Gists

This sample script retrieves the cell coordinates of cells with the quote prefix. In Google Spreadsheet, when a single quote is added to the top letter of the cell value, the cell is used as the text value. When we want to search the cells with the quote prefix in Spreadsheet, unfortunately, in the current stage, this cannot be achieved using Spreadsheet service (SpreadsheetApp) and Sheets API. In this method, such cells can be retrieved. The output values are the cell coordinates of the cells with the quote prefix.

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.

Retrieving Data from Content-Type of 'text/event-stream' using Javascript and Google Apps Script

Gists

This is a sample script for retrieving the data from Content-Type of ’text/event-stream’ using Javascript and Google Apps Script.

In the current stage, UrlFetchApp of Google Apps Script cannot be retrieved the data from Content-Type of ’text/event-stream’. This sample script can be used for achieving this as a workaround.

This sample script uses EventSource. So this script uses a dialog on Google Docs files (This sample uses Google Spreadsheet.).

Usage

1. Prepare Spreadsheet.

Create new Google Spreadsheet.

Enhanced makeCopy() using Google Apps Script

Gists

Overview

This is sample scripts for copying files to a specific folder in Google Drive using Google Apps Script (GAS).

Description

When the files in Google Drive are copied to a specific folder using GAS, most users will use makeCopy(destination). When the files are copied using makeCopy(), you might have already noticed that only the standalone projects cannot be copied to the specific folder. They are copied to the root folder (My Drive). Also this situation can be also seen even when “copy” of Drive API v2 and v3 is used. I think that this might be a bug. So I would like to introduce 2 sample scripts as the workaround. In the workaround, it uses Drive API.