V8 Runtime was added to Google Apps Script at February 7, 2020

Gists

In my environment, at February 7, 2020, when I opened the script editor of Google Apps Script, the following notification could be seen.

V8 Runtime was added to Google Apps Script at February 7, 2020

By this, I could notice that finally, the V8 Runtime has already been added to Google Apps Script. I think that this will be also the great news for a lot of users including me.

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.

Updated goodls to v125

  • v1.2.5 (January 29, 2020)

    1. An option for selecting whether the top directory is created was added.
      • $ goodls -u [URL] --notcreatetopdirectory or $ goodls -u [URL] -ntd
      • When this option is NOT used (default situation), when a folder including sub-folders is downloaded, the top folder which is downloaded is created as the top directory under the working directory. When this option is used, the top directory is not created and all files and sub-folders under the top folder are downloaded under the working directory.
      • This feature request was implemented.

The detail information and how to get this are https://github.com/tanaikech/goodls.

URL Encode with Shift-JIS using Google Apps Script

Gists

This is a sample script for achieving the URL encode with Shift-JIS using Google Apps Script.

Unfortunately, there are no methods for directly achieving above in the methods of Google Apps Script. So it is required to prepare it as the script. In order to use Shift-JIS of the character set at Google Apps Script, it is required to use it as the binary data. Because, when the value of Shift-JIS is retrieved as the string by Google Apps Script, the character set is automatically changed to UTF-8. Please be careful this.

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

Deleting Last Empty Page of Google Document using Google Apps Script

Gists

Overview

This is a sample script for deleting the last empty page which has only one paragraph including no values which is "" in the Google Document using Google Apps Script.

Description

As a sample situation, it supposes that there is the following Google Document.

Deleting Last Empty Page of Google Document using Google Apps Script

In this sample, the last page of Google Document has only one paragraph including no values which is "". When I try to delete only last page without modifying the previous page, I noticed that this cannot be achieved with only Google Document service. For example, it try to delete the paragraph of the last page using the following scripts,

Trend of google-apps-script Tag on Stackoverflow 2020

Gists

Published: January 10, 2020

Kanshi Tanaike

Introduction

At Stackoverflow, a lot of people post the questions and answers to the questions every day. There are various tags in Stackoverflow. A lot of discussions are performed at each tag. Their discussions bring the important information and are much useful for a lot of people. As one of tags, there is “google-apps-script”. I sometimes discuss at the questions with that tag. When we see the discussions, we can notice that the discussions are changed and progressed by the time, because “Google Apps Script” which is the origin of the tag is updated. This report thinks this change as the trend of tag of “google-apps-script”. This trend includes the number of questions, questioners, answerers and tags adding to the tag of “google-apps-script”. The trend of tag of “google-apps-script” is deeply related to the progression of Google Apps Script and the various applications for Google Apps Script.

Retrieving Event ID from Event URL of Google Calendar using Google Apps Script

Gists

This is a sample script for retrieving the event ID from the event URL of Google Calendar using Google Apps Script.

The event URL is like https://www.google.com/calendar/event?###. At the event URL, ### of https://www.google.com/calendar/event?### is not the event ID. So it is required to convert it.

Sample script

var eventUrl = "https://www.google.com/calendar/event?###";
var eventId = Utilities.newBlob(Utilities.base64Decode(eventUrl.split("=")[1]))
  .getDataAsString()
  .split(" ")[0];
Logger.log(eventId);