Creating Colorful Buttons on Google Spreadsheet using Google Apps Script

Gists

This is a sample script for creating the colorful buttons on Google Spreadsheet on Google Apps Script.

In order to achieve this, I have been looking for the method for creating the PNG image with the alpha channel using Google Apps Script. Recently, finally, I could find it. By this, the goal of this report got to be able to be achieved by the report of “Creating PNG Image with Alpha Channel using Google Apps Script”.

Creating PNG Image with Alpha Channel using Google Apps Script

This is a sample script for creating a PNG image with the alpha channel using Google Apps Script.

The PNG image with the alpha channel is the image includes the transparent background. I have been looking for the method for creating such image using Google Apps Script. It is considered that when this will be achieved, it will be able to be used for various situations. For example, it is considered the following situations.

A Bug of New IDE about Time Zone of Google Apps Script project was removed

Gists

I had confirmed a bug of new IDE about the time zone of Google Apps script project. When I created new Google Apps Script project using new IDE, the time zone of GAS project is always America/New_York. In my area, it’s Asia/Tokyo. The time zone can be confirmed at appscript.json.

So, I had reported this issue to Google issue tracker. Ref After I posted this, I had also confirmed this issue at Stackoverflow. Ref

Plotting Points on Image using Google Apps Script

Gists

This is a sample script for plotting the points on an image using Google Apps Script.

Unfortunately, in the current stage, there are no methods for directly editing the image and putting the texts and some shapes in the methods for Google Apps Script. So in this case, it is required to use the workaround.

Fortunately, I have already published a report about “Inserting Text on Image using Google Apps Script” in my blog. Ref In this report, this sample is used.

Redeploying Web Apps without Changing URL of Web Apps for new IDE

Gists

At March 15, 2021, one endpoint is created for one deployment. Ref By this, when you redeploy “Web Apps”, the endpoint is changed. Because the deployment ID is changed. It seems that this it the new specification. In this report, I would like to introduce the method for redeploying Web Apps without changing the URL of Web Apps for new IDE.

Deploy Web Apps

  1. Open “New deployment” dialog with “Deploy” -> “New deployment”.

Copying Protections for Spreadsheet using Google Apps Script

Gists

This is a sample script for copying the protections for Spreadsheet using Google Apps Script. When several protections of the sheet protection and the range protection are set to a Google Spreadsheet and the Spreadsheet is copied using the script and the manual copy with the browser, unfortunately, the protections of ranges are not copied. And also, the protections of sheets can be copied. But, the editor emails are not included. It seems that this is the current specification.

Updated: CLI Tool - gislack

gislack is a CLI tool to submit files to both Gist and Slack.

  • v1.0.4 (February 27, 2021)

    1. I noticed that this application uses the duplicated methods of Slack API. Ref By this, the duplicated methods were updated to the new methods as follows.

      • From “channels.list” to “conversations.list”.
      • From “channels.history” to “conversations.history”.

Please check it out. https://github.com/tanaikech/gislack

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.

Javascript library - HtmlFormObjectParserForGoogleAppsScript_js

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.