Gist
This sample script is for uploading image files to Slack using Incoming Webhooks by Google Apps Script.
When users try to upload image files to Slack using Incoming Webhooks, it has been known that although the access token is required to directly upload them, Incoming Webhooks can upload them by using the tag of image_url. In this sample script, it uploads image files (BMP, GIF, JPEG and PNG) on Google Drive to Slack using Incoming Webhooks.
Gists
This sample script is for retrieving files with filename included special characters using Google Apps Script. The files are used on Google Drive.
The files with filename of special characters cannot be retrieved using DriveApp.getFilesByName(). This workaround solved this.
As a query parameter, name contains 'filename with special characters' is used. This contains is very important. name='filename with special characters' cannot retrieve such files. Today, it was found that name contains 'filename with special characters' is the workaround.
Gists
This sample script is for removing duplicated values in array using CoffeeScript.
ar = ["a", "b", "c", "a", "c"] res = ar.filter (e, i, s) -> s.indexOf(e) is i console.log res >>> [ 'a', 'b', 'c' ] The result which was compiled by CoffeeScript is as follows.
var ar, res; ar = ["a", "b", "c", "a", "c"]; res = ar.filter(function(e, i, s) { return s.indexOf(e) === i; }); console.
Here, it introduces an application of Retrieving Spreadsheet ID from Range using Google Apps Script.
Please check this. https://github.com/tanaikech/getSpreadsheetByRange
Gists
This is a sample script for retrieving spreadsheet ID from a range using Google Apps Script. I sometimes want to retrieve spreadsheet ID from ranges. In such case, I always use this.
Range -> Retrieve Sheet using getSheet() -> Retrieve Spreadsheet using getParent() -> Retrieve spreadsheet ID var id = "123456789abcdefg"; var sheet = "Sheet"; var cells = "a1:b10"; var range = SpreadsheetApp.openById(id).getSheetByName(sheet).getRange(cells); var id = range.