Showing posts with label Google Apps Script. Show all posts
Showing posts with label Google Apps Script. Show all posts

Friday, 28 February 2014

Learning to Program In Google Apps Script (Part 2)

google-chromebook-logo

In part two I'll go through some more of the Google Apps Script tutorials.

The third Script


The third Script is basically just creating a custom function that uses Google Sheets to convert from Inches to Millimeters, it's not as complex as the script used in the first of the Google Sheets Scripts that was the second of the tutorials that I did in the last part.

The fourth Script


The fourth Script is still pretty basic but it's a little more advanced as it uses a Google Sheets Spreadsheet to send messages to multiple recipients, this could be used to send basic emails to multiple contacts. But in reality I think it's just an example of what you can do with Scripts in Google Sheets.

In the next part of this series I'll go through some more of the tutorials.

Roland

Previous

Google+

Tuesday, 25 February 2014

Learning to Program In Google Apps Script (Part 1)

google-chromebook-logo

Setting up Google Apps Script


The first thing that needs to be done is to Install the Google Apps Script web app from the Chrome Store, using the web app for Apps Script will prevent you from losing the bookmark in your bookmarks folder in Chrome and will make it easier to open Google Apps Script when you're using Chrome OS as you'll be able to pin it to the Chrome OS Shelf.

The Google Apps Script IDE


The Google Apps Script may look lightweight and simple when you first open it, but from reading what Apps Script can do on the Google Developers Apps Script tutorial site it looks like a very powerful scripting language.

Creating a first Script


Google Apps Script is based on the JavaScript scripting language so anyone proficient in JavaScript should feel right at home and only need to learn how to use the Google specific pieces of code to write a script or customization. for anyone who doesn't know how to code in JavaScript the I'd recommend using the tutorials here and set up your workspace so you can follow the tutorials without having to switch between Chrome and Google Apps Script (if you're using Chrome OS I'd even alter the resolution of your Chromebook, Chromebox or Chromebase so that you can snap Chrome and Google Apps script to the sides without any overlap 1536x864 resolution, it's not the best for playing YouTube videos, but if you need to maximize your screen real estate then it'll be ok, just remember to drop down to the recommended resolution when you've finished )

The first script in the tutorials


The first script in the tutorials is a simple one, but when I tried it I keep getting an error saying TypeError: Cannot find function getbody in object Document. (line 6, file "Code")

[caption id="attachment_1954" align="aligncenter" width="300"]Error message Error message[/caption]

But yet if I copy and past the code into the Apps Script editor it works without any problems what so ever.

Extending Google Sheets


The second example in the tutorials is a simple case of downloading a sample Google Sheets Spreadsheet into your Google Drive library and copying the sample code into the Apps Script editor and following the tutorial instructions for running the script. it doesn't teach you much in the way of coding the particular Script but you can always look through the code that you've copied at your leisure, but the tutorial shows you some of the advanced scripts & customization that you can do with Apps Script.


In the next part I'll go through another two maybe three of the tutorials from the Google Developers website.


Roland


Next


Google+

Monday, 24 February 2014

Programming in Chrome OS

google-chromebook-logo

When it comes to programming in Chrome OS the main language and IDE is Google Apps Script. Google Apps Script is a Scripting language based on JavaScript. Google Apps Script can be thought of as similar to the VBA Scripting language used to develop automation style Add-ons in Microsoft Office.

Google Apps Script is used to develop customizations and automation Scripts for Google Services such as Google Docs, Sheets, Slides, Forms and much more.

[caption id="attachment_1941" align="aligncenter" width="300"]Google Apps Script project selection window Google Apps Script project selection window[/caption]

Google Apps Script's IDE looks like the IDE from any other language, but with several differences.

  1. Google Apps Script can't be used to create complex applications like you can with Python, C, C#, C++, Visual Basic as it's more like VBA meets JavaScript.

  2. Google Apps Script can't create Scripts for Microsoft Office as that requires VBA (but it might be possible to create Scripts for anything written in JavaScript).

  3. If you want to create anything big and complex like an OS and OS Kernel then you might be better with something like Assembly language or C or C++.


[caption id="attachment_1942" align="aligncenter" width="300"]Google Apps Script Code Editor Google Apps Script Code Editor[/caption]

If you are proficient in JavaScript then it's entirely possible that you can write some pretty complex customizations or even automation scripts for Google services.

If like me you're new to Google Apps Script or even writing code then a wealth of tutorials and information can be found on the Google Developers website.

If you want to create something a bit more complex than what you can create in Google Apps Script while still using Chrome OS then there is the Nitrous.IO IDE that can create Python, PHP, Ruby/Rails, Node.js & Go programming languages, but for the average Chrome OS user then I think Google Apps Script will be more than adequate. Google Apps Script will be enough for professionals that are ether using Chrome OS or just the plain old Google Apps service on a Windows, Mac or Linux setup as Google Apps Script is a cloud based scripting service and your scripts are stored in Google Drive then it makes it a truly cross-platform  language that can be used on any of your devices (I'm not sure if scripts or customizations will work on the mobile versions of Google Drive or not).


My next Chrome OS series will be on learning how to create scripts and customizations for the Google services that are supported by Google Apps Script.

Roland

Google+

Advertisement

BBC News - Sheffield & South Yorkshire