Skip to content

Instantly share code, notes, and snippets.

Avatar

Kanshi TANAIKE tanaikech

View GitHub Profile
@tanaikech
tanaikech / submit.md
Created Apr 6, 2021
A Bug of New IDE about Time Zone of Google Apps Script project was removed
View submit.md

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

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

Today, I got a report from Google issue tracker. When I tested above, I could confirm that the issue was removed. When I created new Google Apps Script project, I confirmed that the value of timeZone in appsscript.json is Asia/Tokyo. So I reported this here.

@tanaikech
tanaikech / submit.md
Created Apr 2, 2021
Plotting Points on Image using Google Apps Script
View submit.md

Plotting Points on Image using Google Apps Script

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.

Usage

@tanaikech
tanaikech / submit.md
Last active Mar 30, 2021
Redeploying Web Apps without Changing URL of Web Apps for new IDE
View submit.md

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

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".

  2. Select "Web app" for "Select type".

@tanaikech
tanaikech / submit.md
Last active Mar 28, 2021
Copying Protections for Spreadsheet using Google Apps Script
View submit.md

Copying Protections for Spreadsheet using Google Apps Script

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.

In this post, I would like to introduce a sample script for copying all protection conditions.

Sample script

Please add the following function to your script. And, please enable Sheets API at Advanced Google services.

@tanaikech
tanaikech / submit.md
Last active Feb 2, 2021
XPath Tester using Web Apps Created by Google Apps Script
View submit.md

XPath Tester using Web Apps Created by Google Apps Script

In this post, I would like to introduce the xpath tester using Web Apps created by Google Apps Script.

Demo

Usage

@tanaikech
tanaikech / submit.md
Created Jan 16, 2021
Trend of google-apps-script Tag on Stackoverflow 2021
View submit.md

Trend of google-apps-script Tag on Stackoverflow 2021

Published: January 16, 2021

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.

@tanaikech
tanaikech / submit.md
Created Jan 13, 2021
Creating Custom Grid View of Google Slides as Image and Spreadsheet using Google Apps Script
View submit.md

Creating Custom Grid View of Google Slides as Image and Spreadsheet using Google Apps Script

This is a sample script for creating the custom grid view of Google Slides as an image using Google Apps Script.

Demo

Usage

@tanaikech
tanaikech / submit.md
Created Jan 10, 2021
Adding Slide Page Link to Shape using Google Apps Script
View submit.md

Adding Slide Page Link to Shape using Google Apps Script

This is a sample script for adding the slide page link to the shape using Google Apps Script.

When I use Google Slides, there is the case that I want to jump to the specific slide on the same Google Slides. And, I have the case that I want to jump from the last slide to the 1st slide. In those cases, I had manually added the slide page link to each shape. But when the number of slides are large, I thought that when a script for achieving this is prepared, it will be useful. So I created this.

Demo

@tanaikech
tanaikech / submit.md
Last active Jan 6, 2021
Simple Script of Resumable Upload with Google Drive API for Axios
View submit.md

Simple Script of Resumable Upload with Google Drive API for Axios

This is a simple sample script for achieving the resumable upload to Google Drive using Axios. In order to achieve the resumable upload, at first, it is required to retrieve the location, which is the endpoint of upload. The location is included in the response headers. After the location was retrieved, the file can be uploaded to the location URL.

In this sample, a text data is uploaded with the resumable upload using a single chunk.

Upload Data using Single Chunk

This sample script achieves the resumable upload using a single chunk.

Sample script

@tanaikech
tanaikech / submit.md
Created Jan 5, 2021
Downloading and Uploading File to Google Drive without Saving File with Stream and Resumable Upload using Node.js
View submit.md

Downloading and Uploading File to Google Drive without Saving File with Stream and Resumable Upload using Node.js

This is a sample script of Node.js for downloading the data and uploading the data to Google Drive with the resumable upload without saving it as a file. The downloaded data is uploaded to Google Drive with the stream.

Sample script

Before you use this, please set the variables of accessToken, url, fileSize, mimeType and filename. In this case, fileSize is required to set because the data is uploaded with the resumable upload.

const request = require("request");