Overview This is a GAS project library for Google Apps Script (GAS). This library can be used for the projects of both standalone script type and container-bound script type.
Description There are Class SpreadsheetApp and Class DocumentApp for operating spreadsheet and document, respectively. But there is no Class for operating GAS project. If there is such Class ProjectApp, GAS project can be directly operated by GAS script. I thought that this will lead to new applications, and created ProjectApp.
google.script.run doesn’t return values. So I tried this using jQuery.Deferred.
GAS : Code.gs function doGet() { return HtmlService.createHtmlOutputFromFile('index') .setSandboxMode(HtmlService.SandboxMode.IFRAME); } function getValues(e) { return e + "hoge"; } HTML : index.html <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.js"></script> <body> <input type="button" id="button" value="ok"> <div id="result"></div> <script> $(() => { $("#button").click(() => { var str = "fuga"; googleScriptRun(str).then((res) => { $('#result').text(res); }); }); }); function googleScriptRun(str) { var d = new $.
ggsrun was updated to v.1.4.0 v1.4.0 (January 25, 2018)
Google Apps Script API was finally released. From this version, ggsrun uses this API. So ggsrun got to be able to use not only projects of standalone script type, but also projects of container-bound script type. I hope this updated ggsrun will be useful for you.
To users which are using ggsrun with v1.3.4 and/or less. For retrieving, downloading, creating and updating projects, Apps Script API is used.
Gists
Pattern 1 This is a sample script for copying GAS project to a container-bound script of Google Docs (Spreadsheet, Document and Form (and Slides)). The project is created as a new project.
In order to use this sample, please do the following installation flow.
If you use this sample script, at first, please test using a new project and new Google Docs. By this, please understand the work of this script.
Gists
There is the bathing requests in the Google APIs. The bathing requests can use the several API calls as a single HTTP request. By using this, for example, users can modify filenames of a lot of files on Google Drive. But there are limitations for the number of API calls which can process in one batch request. For example, Drive API can be used the maximum of 100 calls in one batch request.