Skip to content

Instantly share code, notes, and snippets.

View cooltables's full-sized avatar

Макс Махров cooltables

View GitHub Profile
@tanaikech
tanaikech / submit.md
Created November 10, 2020 06:32
Downloading Google Spreadsheet as XLSX and PDF file by Clicking Button

Downloading Google Spreadsheet as XLSX and PDF file by Clicking Button

This is a sample script for downloading Google Spreadsheet to the local PC as a XLSX file and a PDF file when a button on the side bar and the dialog is clicked. This is created with Google Apps Script and HTML&Javascript.

Sample script

Please create new Google Spreadsheet and copy and paste the following scripts to the script editor. And please run openSidebar(). By this, the side bar is opened to the Spreadsheet.

@tanaikech
tanaikech / submit.md
Last active May 31, 2022 01:44
Request of multipart/form-data with Simple Request Body using Google Apps Script

Request of multipart/form-data with Simple Request Body using Google Apps Script

This is a sample script of the request of multipart/form-data with a simple request body using Google Apps Script. I hope that the users will easy to use Class UrlFetchApp by this report.

This report is the updated post of "Multipart-POST Request Using Google Apps Script".

Description

I had already reported about this at this report. In that case, it was required to create a bit complicated request body to request multipart/form-data. Today, by a comment, I could notice the sample script of Class UrlFetchApp in the official document had been updated. By this, I thought that multipart/form-data

@tanaikech
tanaikech / submit.md
Last active January 3, 2023 00:46
Inserting Text on Image using Google Apps Script
@tanaikech
tanaikech / submit.md
Last active November 19, 2022 06:08
Sorting Cells on Google Spreadsheet with Background colors using Google Apps Script

Sorting Cells on Google Spreadsheet with Background colors using Google Apps Script

This is a sample script for sorting the cells on Google Spreadsheet with the background colors using Google Apps Script.

Unfortunately, in the current stage, it seems that sort(sortSpecObj) of Class Range cannot directly sort by the background colors of cells. But when Sheets API is used, this goal can be achieved. Here, "SortRangeRequest" of the method of "spreadsheets.batchUpdate" in Sheets API is used.

Flow

@tanaikech
tanaikech / submit.md
Last active September 24, 2023 12:48
Google Apps Script: Running Specific Function When Specific Sheet is Edited on Google Spreadsheet

Google Apps Script: Running Specific Function When Specific Sheet is Edited on Google Spreadsheet

This is a sample Google Apps Script for running the specific function when the specific sheet is edited.

Sample script

Please copy and paste the following script to the container-bound script of Spreadsheet and set sheets object.

// When the cells are edited, this function is run by the fire of event trigger.