Gists
This is a sample script for replacing the multiple paragraphs on Google Document with a regex using Google Apps Script. There is the method of replaceText(searchPattern, replacement) for replacing the text on Google Document. Ref For example, when a text of sample1 is replaced with sample2, this can be achieved by a script like DocumentApp.getActiveDocument().getBody().replaceText("sample1", "sample2"). But, when the texts for replacing are the multiple paragraphs, this script cannot be used.
Gists
This is a sample script for simply converting HTML to plain text using Google Apps Script.
Sample values HTML (input value) <div id="sample1">sample text1</div> <div id="sample2">sample text2</div> <ul id="sample3"> <li>sample list 1</li> <li>sample list 2</li> </ul> <table id="sample4"> <tbody> <tr> <td>a1</td> <td>b1</td> <td>c1</td> </tr> <tr> <td>a2</td> <td>b2</td> <td>c2</td> </tr> </tbody> </table> Text (output value) sample text1
sample text2
- sample list 1
- sample list 2
a1 b1 c1
a2 b2 c2 Sample script function myFunction() { const sampleHTML = `<div id="sample1">sample text1</div> <div id="sample2">sample text2</div> <ul id="sample3"> <li>sample list 1</li> <li>sample list 2</li> </ul> <table id="sample4"> <tbody> <tr> <td>a1</td> <td>b1</td> <td>c1</td> </tr> <tr> <td>a2</td> <td>b2</td> <td>c2</td> </tr> </tbody> </table>`; const temp = GmailApp.
Gists
This is a sample Google Apps Script for processing the values in Google Spreadsheet. In this sample situation, each row is merged using the same header title.
In this sample script, the sample input and output situations are as follows.
Sample situation Input: Output: Sample script In this sample script, this sample can be used as the custom function.
function SAMPLE(values) { const headers = [ ...new Set( values .
On April 13, 2022, “Additional functionality for the Apps Script Integrated Development Environment (IDE) Script Editor” has been reported.
They say as follows.
We’re now adding several new features to the IDE to help achieve functional parity with the legacy IDE experience. These features are:
Script Properties Add-on Testing Time Zone Setting Rhino Debugging By this update, I believe that the script editor will be more useful.
Gists
This is a sample script for creating quizzes in Google Form using Google Forms Service with Google Apps Script.
Usage 1. Prepare questions and answers. In this sample, the questions and answers are prepared using Spreadsheet as follows.
2. Sample script. This script is container-bound script of the above Spreadsheet.
function myFunction() { const formTitle = "sample"; // This is a form title. const sheetName = "Sheet1"; // This is a sheet name.