tanaike

The Thinker

Converting A1Notation to GridRange and vice versa using Google Apps Script without any Scopes

Gists This is a sample script for converting A1Notation to GridRange and vice versa using Google Apps Script without any scopes. A1Notation and GridRange are often used with Sheets API. I have posted a sample script for converting A1Notation to GridRange before. Ref But, in that case, I used the method of Spreadsheet service (SpreadsheetApp). By this, in order to use the script, it is required to authorize the scopes. In this sample script, A1Notation can be converted to GridRange and vice versa with no scopes.

Shortening a Long URL using Firebase Dynamic Links API with Google Apps Script

Gists This is a sample script for shortening a long URL using Firebase Dynamic Links API with Google Apps Script. IMPORTANT Before you use this script, please create a new Firebase project and link it to your Google Cloud Platform Project. Ref And, please enable Firebase Dynamic Links API at the API console. And then, please create your API key from your Google Cloud Platform Project. Sample script const apiKey = "###"; // Please set your API key.

Protecting Cells of Spreadsheet by Clicking Checkbox using Google Apps Script

Gists This is a sample script for protecting the cells of a Spreadsheet by clicking a checkbox using Google Apps Script. You might have a situation where you want to protect the cells when a user checks a checkbox. This sample script is for achieving this situation. The demonstration of this sample script is as follows. This demonstration is for a user. You can see that when the checkbox is checked, the checkbox and the right side of the checkbox are protected.

Parsing XML Data in Google Apps Script using IMPORTXML

Gists This is a sample flow for parsing XML data in Google Apps Script using IMPORTXML. Recently, it seems that ContentService.MimeType.XML has been removed by the Google side. By this, in the current stage, the XML data cannot be directly loaded by the Web Apps URL with IMPORTXML. From this current situation, I would like to introduce a workaround. In this workaround, the XML data in Google Apps Script is parsed by IMPORTXML of the built-in function of Google Spreadsheet.

Report: Recent Value of ScriptApp.getService().getUrl() in Google Apps Script

There is a method of ScriptApp.getService().getUrl() for obtaining the Web Apps URL in Google Apps Script. Before the V8 runtime is released, this method had returned the endpoint like https://script.google.com/macros/s/{deploymentId}/exec. After the V8 runtime was released, the endpoint of https://script.google.com/macros/s/{deploymentId}/dev was returned. Now, it seems that this returns https://script.google.com/macros/s/###/exec. But, in the current stage, when I access this endpoint, the message of Sorry, unable to open the file at this time.