I'm looking for a way to read the contents of the script.gs files within a standalone Google Apps Script. I can't find a suitable getAs() Mime format in the Docslist.File service that doesn't fail. The context of this is that I want to use the html service/content service to be able to embed public GAS source samples in Google Sites and elsewhere. (in much the same way as embedding Gist Samples). Any ideas?
While Google Apps Script implements a subset of ECMAScript 5, there's nothing forcing it to be asynchronous. While it is true that JavaScript's major power is its asynchronous nature, the Google developers appear to have given that up in favor of a simpler, more straightforward API. UrlFetchApp methods are synchronous.
With the owner account, open the sheet, then script editor. Click on Publish and then Deploy as web app. For Execute the app as , choose User accessing the web app and for Who has access to the app , choose Anyone.
Google Apps ScriptA cloud-based JavaScript platform that lets you integrate with and automate tasks across Google products.
Enable the Google Sheets APIOpen the Apps Script project. Click Editor code. Next to Services, click Add a service add . Select Google Sheets API and click Add.
It is, in fact, possible. This gets Code.gs:
function myFunction() {
throw ScriptApp.getResource("Code").getDataAsString();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With