tanaike

The Thinker

Benchmark: Process Costs for Retrieving 1st Empty Cell and 1st Non Empty Cell of Specific Column in Google Spreadsheet using Google Apps Script

Gists Introduction Here, I would like to report the process costs for retrieving the 1st empty cell or 1st non empty cell of the specific column of Google Spreadsheet using Google Apps Script (GAS). For this situations, the following 2 patterns can be considered. Retrieving 1st empty cell of specific column by searching from TOP of sheet Retrieving 1st NON empty cell of specific column by searching from BOTTOM of sheet

Retrieving Access Token using Service Account for PHP without using googleapis

Gists This is a sample PHP script to retrieve the access token from Service Account of Google without using googleapis. Sample script <?php $private_key = "-----BEGIN PRIVATE KEY-----\n###-----END PRIVATE KEY-----\n"; // private_key of JSON file retrieved by creating Service Account $client_email = "###"; // client_email of JSON file retrieved by creating Service Account $scopes = ["https://www.googleapis.com/auth/drive.readonly"]; // Sample scope $url = "https://www.googleapis.com/oauth2/v4/token"; $header = array("alg" => "RS256", "typ" => "JWT"); $now = floor(time()); $claim = array( "iss" => $client_email, "sub" => $client_email, "scope" => implode(" ", $scopes), "aud" => $url, "exp" => (string)($now + 3600), "iat" => (string)$now, ); $signature = base64_encode(json_encode($header, JSON_UNESCAPED_SLASHES)) .

Changing Font of Selected Text to 'Google Sans' on Google Document using Google Apps Script

Gists This is a sample script for changing the font of selected text to Google Sans on Google Document using Google Apps Script. Sample script Please copy and paste the following script to the script editor of Google Document And, when you use this script, please select a text in Google Document and run the script. By this, the font of selected text is changed to Google Sans. function myFunction() { const selection = DocumentApp.

Specification of Search Query for File List Method in Drive API

Gists In this report, I would like to report about the current specification of the search query for the file list method in Drive API. Recently, I noticed that the specification of the search query for the file list method in Drive API might have been changed. I thought that to know the change of specification of the search query is important for creating the application using Drive API. In this report, I would like to introduce the current specification of the search query.

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