Gists
This is a sample script for merging multiple PDF files as a single PDF file using Google Apps Script.
In this sample script, pdf-lib is used. In the current stage, it seems that this Javascript can be directly used with Google Apps Script.
Sample script 1 As a sample situation, please put multiple PDF files in your Google Drive. This sample merges those PDF files as a single PDF file.
Gists
This is a sample script for transferring the ownership of a file to another user using Google Apps Script.
In the current stage, about the consumer account (gmail.com) the specification for transferring the ownership of a file has been changed as follows. Ref
The current owner initiates an ownership transfer by creating or updating the prospective new owner’s file permission. The permission must include these settings: role=writer, type=user, and pendingOwner=true.
Gists
This is a sample script for retrieving the start and end of the month in a year using Google Apps Script and Javascript.
Sample script function myFunction() { const year = 2023; // Please set year you expect. const res = [...Array(12)].map((_, i) => [0, 1].map((e) => new Date(year, i + e, 1 - e)) ); console.log(res); console.log(res.map(([a, b]) => [a.toDateString(), b.toDateString()])); } Testing https://jsfiddle.
Gists
Published: January 3, 2023
Kanshi Tanaike
Introduction At Stackoverflow, a lot of people post questions and answers to the questions every day. There are various tags in Stackoverflow. A lot of discussions are performed at each tag. Their discussions bring important information and are much useful for a lot of people. As one of the tags, there is “google-apps-script”. I sometimes discuss the questions with that tag. When we see the discussions, we can notice that the discussions are changed and progressed over time, because “Google Apps Script” which is the origin of the tag is updated.
Gists
This is a simple sample script for filtering JSON objects using Google Apps Script.
In the current stage, V8 runtime can be used with Google Apps Script. By this, when you want to filter a JSON object, you can use the following sample script.
Sample script In this sample script, obj is filtered by the value of the even number.
const obj = { key1: 1, key2: 2, key3: 3, key4: 4, key5: 5 }; const res = Object.