Skip to content

Instantly share code, notes, and snippets.

Kanshi TANAIKE tanaikech

Block or report user

Report or block tanaikech

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tanaikech
tanaikech / submit.md
Created Nov 11, 2019
Figma to Google Slides using Google Apps Script
View submit.md

Figma to Google Slides using Google Apps Script

In this sample script, all pages in the Figma file are retrieved and the retrieved pages are put to new Google Slides as the image.

Usage

1. Retrieve access token

You can see the method for retrieving the access token at here. Although there is also OAuth2 for retrieving the access token, in your situation, I thought that the method for directly generating the access token on the site might be suitable. So in this answer, the generated access token on the site is used. Please retrieve the access token as follows.

@tanaikech
tanaikech / submit.md
Created Nov 8, 2019
Retrieving Values from Sheet Filtered by Slicer in Spreadsheet using Google Apps Script
View submit.md

Retrieving Values from Sheet Filtered by Slicer in Spreadsheet using Google Apps Script

Overview

This is a sample script for retrieving values from a sheet filtered by Slicer in Spreadsheet using Google Apps Script.

Description

By the update of Google side at November 6, 2019, Class Slicer was added. And also, for Sheets API, AddSlicerRequest and UpdateSlicerSpecRequest were added. By this, Slicer of Spreadsheet got to be able to be managed with Google Apps Script and other languages.

@tanaikech
tanaikech / submit.md
Last active Oct 27, 2019
Automatic Recalculation of Custom Function on Spreadsheet Part 2
View submit.md

Automatic Recalculation of Custom Function on Spreadsheet Part 2

Description

I have already reported about "Automatic Recalculation of Custom Function on Spreadsheet Part 1" at here. Here, I would like to introduce other workaround for forcibly recalculating the custom functions and built-in functions using Class TextFinder. Class TextFinder has added at April 5, 2019. By this, this workaround can be proposed.

Sample scripts

Pattern 1

@tanaikech
tanaikech / submit.md
Last active Sep 16, 2019
Modifying Revisions of a File on Google Drive using Google Apps Script
View submit.md

Modifying Revisions of a File on Google Drive using Google Apps Script

This is a sample script for modifying the revisions of a file on Google Drive using Google Apps Script. This script can be used for not only Google Docs files, but also the files except for Google Docs.

Issue and workaround:

Unfortunately, in the current stage, at Google Docs files, the revision of Google Docs cannot be directly changed by APIs with a script. So as one of several workarounds, I would like to propose to overwrite the Google Docs file using the exported data. On the other hand, at the files except for Google Docs, the data can be directly retrieved with the revision ID. This can be used for overwriting the file. The flow of this script is as follows.

For Google Docs files:

@tanaikech
tanaikech / submit.md
Created Aug 28, 2019
Benchmark: Importing CSV Data to Spreadsheet using Google Apps Script
View submit.md

Benchmark: Importing CSV Data to Spreadsheet using Google Apps Script

August 28, 2019 Published.

Kanshi Tanaike

@tanaikech
tanaikech / submit.md
Created Aug 26, 2019
Running Functions by Specifying Function Names with Web Apps for Google Apps Script
View submit.md

Running Functions by Specifying Function Names with Web Apps for Google Apps Script

In this report, I would like to introduce the method for running functions by directly specifying the function names with Web Apps for Google Apps Script.

Description

It has already been known that the directly specified functions in the project can be run from the outside by enabling "API executable" and using the method of scripts.run in Google Apps Script API. In this case, the installation for using Apps Script API is a bit complicate. I think that this is making users difficult to use Apps Script API, although the important settings are including in the installation when the importance of the security is considered. As one of workarounds for making easy to run the directly specified functions in the project, I would like to introduce the method using Web Apps. When Web Apps is accessed, the functions of doGet() and doPost() are used. Th

@tanaikech
tanaikech / submit.md
Created Aug 11, 2019
Examples of How to Derive a Signing Key for Signature Version 4 for Google Apps Script
View submit.md

Examples of How to Derive a Signing Key for Signature Version 4 for Google Apps Script

This is a sample script for "Examples of How to Derive a Signing Key for Signature Version 4" using Google Apps Script.

In order to use AWS SDKs, there are the sample scripts for the languages of Java, .NET (C#), Python, Ruby, JavaScript (Node.js). But the sample script of Google Apps Script is not prepared. I saw the question related to this at Stackoverflow. So I would like to also introduce the sample script here.

In the sample scripts, the input values are as follows.

key = 'wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY'
@tanaikech
tanaikech / submit.md
Last active Aug 1, 2019
Parsing HTML using Google Apps Script
View submit.md

Parsing HTML using Google Apps Script

This is a sample script for parsing HTML using Google Apps Script. When HTML data is converted to Google Document, the HTML data can be parsed and be converted to Google Document. In this case, the paragraphs, lists and tables are included. From this situation, I thought that this situation can be used for parsing HTML using Google Apps Script. So I could came up with this method.

In the Sheet API, the HTML data can be put to the Spreadsheet with the PasteDataRequest. But unfortunately, in this case, I couldn't distinguish between the body and tables.

The flow of this method is as follows. In this sample script, the tables from HTML are retrieved.

Flow

@tanaikech
tanaikech / submit.md
Last active Oct 22, 2019
Retrieving Values from Filtered Sheet in Spreadsheet using Google Apps Script
View submit.md

Retrieving Values from Filtered Sheet in Spreadsheet using Google Apps Script

This is a sample script for retrieving values from filtered Sheet in Spreadsheet using Google Apps Script. When the values are retrieved the filtered sheet by the basic filter, if setValues() and setDisplayValues() are used, all values without the filter are retrieved. In this script, I would like to introduce the method for retrieving the values from the filtered sheet using Google Apps Script.

In order to retrieve the values from the filtered sheet, one method has already been proposed. That method retrieved the values from the filtered sheet by retrieving columnMetadata and rowMetadata of the method of spreadsheet.get of Sheets API. In this case, the rows and columns hidden by the filter can be retrieved.

In this sample script, columnMetadata and rowMetadata of the method of spreadsheet.get of Sheets API are not used. The values are directly retrieved.

Spreadsheet

@tanaikech
tanaikech / submit.md
Created Jul 23, 2019
Resumable Uploading Files to Google Drive using Golang
View submit.md

Resumable Uploading Files to Google Drive using Golang

This is a sample script for the resumable upload of Files to Google Drive using Golang. This script uses the library of google-api-go-client. About the installation of google-api-go-client, please check the Quickstart for golang at the official site.

Sample script:

package main

import (
You can’t perform that action at this time.