SUPPORT THE WORK

GetWiki

Google Apps Script

ARTICLE SUBJECTS
aesthetics  →
being  →
complexity  →
database  →
enterprise  →
ethics  →
fiction  →
history  →
internet  →
knowledge  →
language  →
licensing  →
linux  →
logic  →
method  →
news  →
perception  →
philosophy  →
policy  →
purpose  →
religion  →
science  →
sociology  →
software  →
truth  →
unix  →
wiki  →
ARTICLE TYPES
essay  →
feed  →
help  →
system  →
wiki  →
ARTICLE ORIGINS
critical  →
discussion  →
forked  →
imported  →
original  →
Google Apps Script
[ temporary import ]
please note:
- the content below is remote from Wikipedia
- it has been imported raw for GetWiki
{{Cleanup|date=February 2015|reason=uses lists instead of paragraphs and contains excessive code samples}}{{Advert|date=February 2018}}







factoids
| programming language = JavaScript| genre = Web application framework, scripting languageweblink}}}}Apps Script is a scripting language for light-weight application development in the G Suite platform. It is based on JavaScript 1.6 with some portions of 1.7 and 1.8 and provides subset of ECMAScript 5 API,JOURNAL, Kienle, Holger, It's About Time to Take JavaScript (More) Seriously, IEEE Software, May–June 2010, 27, 3, 60–62,weblink 25 March 2011, 10.1109/MS.2010.76, however instead of running on the client, it gets executed in the Google Cloud. According to Google, Apps Script "provides easy ways to automate tasks across Google products and third party services."Google Apps Script Apps Script is also the tool that powers the add-ons for Google Docs, Sheets and Slides.Bring a little something extra to Docs and Sheets with add-ons

Benefits

  1. Based on JavaScript; easy to learn.
  2. Cloud based debugger for debugging App Scripts in the web browser.
  3. It can be used to create simple tools for an organization's internal consumption.
  4. It can be used to perform simple system administration tasks.
  5. Community-based support model. weblink

Limitations

  1. Processing limitations{{snd}} As a cloud-based service, Apps Script limits the time that a user's script may run, as well as limiting access to Google servicesweblink
  2. Currently Google Apps Store does not allow direct connection to internal (behind-the-firewall) corporate databases, which is key to building business apps, however, via use of the JDBC service, this can be overcome, if connections are allowed from Google servers to the internal database serverweblink Similarly, lack of other connectivity, such as LDAP connectivity, limits the level to which GAS can be used in the enterprise.{{Citation needed|date=November 2012}}
  3. Due to the cloud nature of Apps Script, functions related to date and time will produce results that seem to be incorrect due to the data crossing time zones. Using Date/Time objects and functions without very precise declaration and thorough testing may result in inaccurate results.WEB, Issue 1035: utilities.formatdate subtracts a day.,weblink 17 December 2012,

Example

The following code uses the Apps Script UI Services and DocList Services to display contents of a Google Drive folder in Tree format.Notice the use of JavaScript and the use of Google Web Toolkit widgets (Google also introduced the HTML Service in June 2012, as an alternative to GWT widgets. It lets you serve web pages that can interact with server-side Apps Script functions).function doGet(e) {
var app = UiApp.createApplication();
var scrollPanel = app.createScrollPanel(); // Scroll Panel is a Google Web Toolkit Widget
tree = app.createTree(); // Tree is a Google Web Toolkit Widget
tree.addItem(buildTree(app, "Enterprise 2.0 - Saqib"));
scrollPanel.add(tree);
scrollPanel.setHeight("500");
app.add(scrollPanel);
return app;
}
function buildTree(a, searchTerm) {
var tree = a.createTreeItem(); // TreeItem is Google Web Toolkit Widget
tree.setText(searchTerm);


// Use of the Apps Script DocList Service to retrieve the collections.
var folders = DocsList.getFolder(searchTerm).getFolders();
for (var i = 0; i
< folders.length; i++) {
tree.addItem(buildTree(a, folders[i].getName())).setState(true, true);
}


var files = DocsList.getFolder(searchTerm).getFiles();
for (var i = 0; i < files.length; i++) {
if (files[i].getType() === "document") {
urlBase = "https://docs.google.com/document/edit?id=";
iconHTML = "https://docs.google.com/images/doclist/icon_7_document_list.png";
}
else if (files[i].getType() === "spreadsheet") {
urlBase = "https://spreadsheets.google.com/ccc?key=";
iconHTML = "https://docs.google.com/images/doclist/icon_7_spreadsheet_list.png";
}
else if (files[i].getType() === "presentation") {
urlBase = "https://docs.google.com/present/edit?id=";
iconHTML = "https://docs.google.com/images/doclist/icon_7_presentation_list.png";
}
else if (files[i].getType() === "drawing") {
urlBase = "https://docs.google.com/drawings/edit?id=";
iconHTML = "https://docs.google.com/images/doclist/icon_7_drawing_list.png";
}
else {
urlBase = "https://docs.google.com/fileview?id=";
iconHTML = "https://docs.google.com/images/doclist/icon_7_generic_list.png";
}

var image = a.createImage(iconHTML);
var fileLabel = a.createAnchor(files[i].getName(), urlBase+ files[i].getId());
var fileLabelPanel = a.createHorizontalPanel();
fileLabelPanel.add(image);
fileLabelPanel.add(fileLabel);
tree.addItem(fileLabelPanel).setState(true, true);
}
return tree;
}Embedding HTML in GAS with a GWT Widget:weblink GAS HTML class documentationfunction doGet() {
var app = UiApp.createApplication();
app.add(app.createHTML("Hello World!"));
return app;
}

Add-ons

In March 2014, Google introduced add-ons for Docs and Sheets (soon followed by Forms). The add-on stores let users add extra features to Google editors, such as mail-merging, workflows, diagrams builders,... All add-ons are either 100% built with Apps Script or simply use Apps Script to display a UI in the Google editors while relying on an external backend to perform some tasks. For example, MailChimp, a mail-merging tool, has an add-on for Google Docs that communicates with MailChimp platform to send emails.Before add-ons, it was possible to publish scripts for Google Sheets in the Script Gallery. When users installed scripts through this gallery, a copy of the Apps Script code was installed on the user's Sheet. With add-ons, the source code is not visible to the end user and everyone is using the latest version published by the developer. This new approach make it easier to support existing code and helped convince several companies, such as MailChimp or LucidChart to invest in Apps Script.As part of the add-ons release, Google also introduced a UI Style GuideUI Style Guide for Add-ons and CSS package to help developers built add-ons that integrate smoothly into the editors. Each add-on is also reviewed by Google before its publication and developers can benefit from advice from Googlers to provide a better user experience. It is not possible to embed ads in add-ons but it is possible to monetize them.I've started a little experiment...

See also

References

{{Reflist}}

External links

{{Google Inc.}}

- content above as imported from Wikipedia
- "Google Apps Script" does not exist on GetWiki (yet)
- time: 6:53am EST - Sat, Feb 16 2019
[ this remote article is provided by Wikipedia ]
LATEST EDITS [ see all ]
GETWIKI 09 MAY 2016
GETWIKI 18 OCT 2015
M.R.M. Parrott
Biographies
GETWIKI 20 AUG 2014
GETWIKI 19 AUG 2014
GETWIKI 18 AUG 2014
Wikinfo
Culture
CONNECT