background preloader

Apps Script

Apps Script

Big Updates for Apps Script Today at Google I/O, we announced many enhancements to Google Apps Script to help you build richer applications and share your apps with users. Apps Script began as a tool for helping users get more done with their Google spreadsheets. Over time, Apps Script has grown to handle much more. We launched as a destination for Apps Script developers. HtmlService can help you create beautiful interfaces using Apps Script. We also launched a better way to store your application's data, ScriptDb . There are also now more options for deploying your web app. Finally, we wanted to make it easy to distribute your apps. We added a lot of new functionality to Apps Script, so in addition to our developer reference documentation , we've also created a new user guide . Building with Google Apps Script has become a lot easier and more powerful.

Apps Script Overview - Google Apps Script Google Apps Script is a scripting language based on JavaScript that lets you do new and cool things with G Suite products like Docs, Sheets, Slides, and Forms. There's nothing to install — we give you a code editor right in your browser, and your scripts run on Google's servers. If you're new to JavaScript, Codecademy offers a great course for beginners. (Note that this course was not developed by and is not associated with Google.) What can Apps Script do? Apps Script is versatile. For a quick demo of Apps Script in action, try one of our 5-minute quickstarts: Macros, Menus, and Custom Functions: Tailor spreadsheet functions to your needs and build reports with custom Google Sheets menu items.Managing Responses for Google Forms: Email Calendar invites and a personalized Google Doc to every user who responds to a form. Your first script The steps below show how to build and run a simple standalone script that creates a Google Doc and emails you a link. Set it up Try it out Learn more

Learning javaScript - Excel Liberation Google apps script is javaScript, with the addition of a set of classes which allow access to Google apps capabilities such as spreadsheet data structures and so on. This means that to be able write Google Apps Script, you have to know javaScript - because javaScript is the language of googleScrpit. This section will show how to do things in javaScript that you already know how to do in VBA. Just like VBA, Google Apps Script has an integrated development environment (IDE). Here's how to kick it off javaScript quick start. Let's look at javaScript essentials quickly so we can get on with writing our first Google App Script. Declaring variables As you might know from other articles on this site, I am a great stickler for declaring everything as precisely as possible, using Option Explicit, and for avoiding the variant type in VBA. Convention for variable names Although some javaScript interpreters don't insist on this, a javaScript line is terminated by a semicolon; Operators The equals sign. a=b

SSH tip: Automatic Reverse Tunnels for Workflow Simplification | I came up with a trick today to simplify the workflow of certain tasks with SSH. The problem this solves is largely driven by a particular annoyance I had with remote SSH file management. Consider the following workflow for locating a remote file and copying it back to the local machine: # Find the remote file: local:~$ ssh remote remote:~$ find . -name 'file.tar.gz' /home/cody/somewhere/deep/file.tar.gz # Ah, there it is! Now I want to copy it back to my local machine. # Pop open a new shell to my local machine in a separate tab and copy the file with scp: local:~$ scp remote:/home/cody/somewhere/deep/file.tar.gz . The reason I have to run scp on my local machine is because it is behind a firewall, so the remote machine can't see it directly. There is a way to get around this limitation with DNS/firewalls, and the answer is by using SSH reverse tunnels to bind your local SSH daemon port to a remote SSH alias. Host remote HostName RemoteForward 8022 localhost:22

Introduction - Google Caja The Caja Compiler is a tool for making third party HTML, CSS and JavaScript safe to embed in your website. It enables rich interaction between the embedding page and the embedded applications. Caja uses an object-capability security model to allow for a wide range of flexible security policies, so that your website can effectively control what embedded third party code can do with user data. The Caja Compiler supports most HTML and CSS and the recently standardized "strict mode" JavaScript version of JavaScript -- even on older browsers that do not support strict mode. Benefits of using Caja New JavaScript Features.

OAuthApp - Google Script Examples This Library makes it easy to use OAuth. It is also flexible in that you can specify any google service names and an optional scope. This is only required if your API is not yet in our list. Project Key: MM5uQxqjwkMiuJW2zE50SgUF7jOZt2NQ8 InstallingUsing Installing the OAuth Library 1. 2. Project Key: MM5uQxqjwkMiuJW2zE50SgUF7jOZt2NQ8 3. *Note that the Identifier is how you call the library. Clicking the blue "Title" link will bring up the documentation window. 4. Using the Library The .getAuth method takes an apiName as its argument from the list below. *Your API not listed? In this example you are going to call on the getAuth(apiName) method. Connect to Google+ function gPlusMe(){ var options = Oauthapp.getAuth('gplus'); var API_KEY = '<YOUR_API_KEY>'; var result = UrlFetchApp.fetch(" var plusObject = Utilities.jsonParse(result.getContentText()); Logger.log(plusObject.displayName); //returns your Name Method: getAuth(apiName, optUserScope)

From VBA to Google Apps Script - Excel Liberation You have built up an expertise and body of work in VBA, but your company is now seriously considering moving to Google Apps and ditching Microsoft Office products. Is it the end of the world? Actually, in the end it's not so hard. You can find the applicationand test data in the VBA to Google Apps Script Roadmapper project download. What is Google Apps Script VBA is to Office as Google Apps Script is to Google Apps. Transitioning from VBA These following article set will take you through an accelerated program to learn javaScript and Google Apps Script with an emphasis on how to use it to do things you already know how to do in VBA, by showing you how it's done in each language. First observation - it's painfully slow compared to the same thing in VBA, but see Optimizing access to sheet values. Abstraction Things we need to get started Power of apps script The Google Apps API is very powerful, and is evolving very quickly. For more like this, see From VBA to Google Apps Script .

What I learned from writing my first Chrome extension · EdGuiness/date-picker Wiki Intro I wrote a Chrome extension to add a calendar (date picker) to any web page. Initially I just wanted to add a calendar to Google forms but then thought it might be useful on other pages as well. How the extension works There are two ways of using the extension. The second way is to click on the extension icon, then pick a date which is copied it to the clipboard: What I learned You need to pay Google before you can publish on the Chrome web store It's just $5, I think they do this to minimise spam submissions. You can also publish outside the Google ecosystem on sites like, though I assume these sites are not curated and are less patronised than the Google web store. If you used the Chrome Developer Dashboard before the first developer preview release of the Chrome Web Store you don't need to pay the fee. The "Hello, World!" It takes literally five minutes. The tutorial really helped. Upload screen captures of your extension to avoid looking crap

JavaScript Client Library for Google APIs Alpha version released By Brendan O’Brien and Antonio Fuentes, Google Developer Team Today we reached another milestone in our efforts to provide infrastructure and tools to make it easier for developers to use Google APIs: we have released the Google APIs Client Library for JavaScript in Alpha. This client library is the latest addition to our suite of client libraries, which already includes Python, PHP, and Java. This compact and efficient client library provides access to all the Google APIs that are listed in the APIs Explorer. The client library is also flexible, supporting multiple browser environments including Chrome 8+, Firefox 3.5+, Internet Explorer 8+, Safari 4+, and Opera 11+. In addition, the JavaScript client library supports OAuth 2.0 authorization methods. You can load the client library using the following script tag: Loading an API and making a request is as easy as executing: To get started, visit the JavaScript Client Library documentation page.