tanaike - Google Apps Script, Gemini API, and Developer Tips

The Thinker

Uploading Local Files to Google Drive without Authorization using HTML Form

Gists This is a sample script for uploading local file to Google Drive without the authorization using HTML form. A selected file in your local PC using HTML form is uploaded to Google Drive and saved to Google Drive. When you use this, at first, please deploy Web Apps. The script is doPost() of following scripts. Script : Google Apps Script function doPost(e) { var data = Utilities.base64Decode(e.parameters.data); var blob = Utilities.

Create New Project with Original Manifests

It was found that you can also create new project with your original Manifests using ggsrun. By using this, for example, when you created new project, the project can have libraries, Advanced Google Services and so on at the initial stage. I think that this can be used as a template for Project. $ ggsrun u -pn [Project name] -f appsscript.json https://github.com/tanaikech/ggsrun/blob/master/help/README.md#ModifyManifests You can check this and download ggsrun at https://github.

Updated ggsrun to v133

ggsrun was updated to v.1.3.3 v1.3.3 (October 30, 2017) At October 24, 2017, “Manifests” which is new function for controlling the properties of Google Apps Script was added (GAS). You can see the detail of “Manifests” here. In order to modify the manifests from local PC, I added this new function to ggsrun. By using this, you can edit the manifests and update it from your local PC.

Measuring Execution Time of Built-In Functions for Google Spreadsheet

Gists This sample script is for measuring the execution time of built-in functions for Google Spreadsheet. Unfortunately, there are not measurement tools for retrieving the execution time of built-in functions. So I thought of about a workaround. Flow : Import a value to a cell. The value is anything good, because this is used as a trigger. Please do this by yourself. Custom functions cannot use setValue(). So I used onEdit().

Straightening Elements in 2 Dimensional Array using Google Apps Script

Gists This sample script is for straightening elements in 2 dimensional array using Google Apps Script (GAS). When applications using Spreadsheet are developed by GAS, it usually uses 2 dimensional array by setValues(). And the lengths of each element are required to be the same. On the other hand, data used for the applications might not be the same length for each element in 2 dimensional array. This sample script can be used under such situation.