Gists
In the current stage, by the current specification, Google Apps Script cannot be directly run on Google Spreadsheet created by Service Account. But, there is a case in that we want to use the OnEdit trigger on the Spreadsheet that the service account is the owner. In this post, I would like to introduce the method for achieving this.
Recently, I published “Using OnEdit Trigger to Google Spreadsheet by Hiding Google Apps Script from Other Users”.
Gists
This is a method for using OnEdit Trigger to Google Spreadsheet by hiding Google Apps Script from other users.
A sample flow for achieving this is as follows.
Flow 1. Create a new Google Spreadsheet. Please create a new Google Spreadsheet. In this flow, this Google Spreadsheet is used for testing the script. And, please copy the Spreadsheet ID. This spreadsheet ID is used.
In this case, even when Spreadsheet has no container-bound script, this goal can be achieved.
Gists
This is a sample script for checking and replacing a character of U+00A0 (no-break space) with U+0020 (space) as Unicode using Google Apps Script.
When I’m seeing the questions on Stackoverflow, I sometimes saw the situation that the script doesn’t work while the script is correct. In this case, there is the case that the reason is due to U+00A0 being used as the spaces. When U+00A0 is used as the spaces, Google Apps Script and formulas cannot be correctly run.
Gists
This is a sample script for setting the line space of paragraphs on Google Documents using Google Apps Script.
When the line space of a paragraph on Google Documents is manually set, you can do it as follows.
When it is set with Google Apps Script, the following script can be used.
function sample1() { const doc = DocumentApp.getActiveDocument(); const body = doc.getBody(); const paragraph = body.
Gists
This is a sample script for opening and closing Google Forms on time using Google Apps Script.
In order to test this sample script, please do the following flow.
Usage 1. Create a new Google Form. Please create a new Google Form and set your sample questions. And, please open the script editor of Google Form.
2. Prepare sample script. Please copy and paste the following script to the script editor of Google Form.