A belated post – 2015 – a year in Apps Script

I’ve more or less stopped using blogger this year – looking back I’ve only made 6 posts since my end of 2014 post summarizing that year. Instead, I’ve been continuing to focus on  desktop liberation site, which I think is more appropriate for the reference type nature of the material. All that’s a kind of lame explanation for being a couple of months late with my annual summary of what’s been going on in the Apps Script world during 2015 (plus a little bit of 2016).

What’s happened to Apps Script in 2015

Here’s a quick summary of the notable changes in the year.

Spreadsheets

  • Apps Script now supports named ranges! This has been a long time coming, and should help you to be able to abstract away data access for persistent sheets.
  • Earlier in year, some additional features were added to improve cell protection capabilities.

Utilities

  • A few base64 encoding functions were added, along with computeRsa256Signature, to improve support for the creation of JWT (JSON Web tokens) from Apps Script, and in particular the ability to use service accounts. Coupled with an improvement in the Developers console to get the service account key as JSON rather than an P12 file, this has really simplified the authorization process. Previously such tokens needed to be signed using complex external JavaScript encryption libraries, and a lot of hacking around.  I use these new utilities in my Oauth2 library, cGoa
  • You can also now change the developers console project associated with a script which simplifies the reuse of resources between scripts.
  • OauthConfig (which supported Oauth1) was deprecated. Since most providers support Oauth2 nowadays it’s not too big of a deal for most.

HtmlService

  • Good riddance to the EMULATED sandbox mode (deprecated in December), which used caja to make sure that hardly any code would run on the client and anything that did would be slow enough to make you not want to bother. Nowadays, using IFRAME sandbox mode, you can run almost any JavaScript safely under the control of HtmlService, including things like Polymer.
  • You can now find out what the browser is using getUserAgent() , but if you really do have browser dependent client code, feature detection is probably a better method in my opinion.
  • The ability to host files on Drive is still available, but it was announced it would be closing later this year.

Script Service

  • Better support for automating behavior with scripts is now available with getInstallationSource and getProjectKey.

Add-ons

  • These came out of developer preview and nowadays are supposed to have a more streamlined approval process. I went through a couple using the old process and it was fairly tedious. In general I still stand by my comments on add-ons in last year’s post (they’ve been a disappointment) .I haven’t tried the streamlined process yet – perhaps someone can comment on their relative experience?
  • The best change for Add-ons was to allow them to be published as standalone scripts (and why on earth wasn’t it this way from the start?). Now you can test a standalone script as an add-on without having to publish it, simply by associating it with a document for the test.

DocsList

  • This was finally disabled, since all the capability is now covered by the superior Drive advanced service and the DriveApp service.


Execution API and Gmail advanced API

  • Strangely these are not mentioned in the official release notes for 2015, but the execution API is pretty cool. It allows you publish a project as an executable API, which you can then execute from other platforms (including other Apps Script projects). Unfortunately, it doesn’t yet support service accounts for authorization and it is very picky about the format of its payload, but it certainly gives food for thought for many opportunities especially for incremental migration.

It’s not a massive list, and not moving at the pace we’d all hope, but many of the improvements are less about adding to Apps Script, than they are about opening up the integration possibilities, because of course the Google APIS (and other APIS) continue to improve and extend. Allowing Apps Script to more easily talk to things like FireBase, Pubsub, the Vision API and so on improves the breadth and scope of what you can do with Apps Script at the core.

The bucket list

In last year’s post I also mentioned a few things we’d like to see in 2015, but sadly, nothing on it has moved along. Here’s the list boiled down into few items, which I’ll leave in place for next year.

  • No improvement in code and library management such as lifecycle management and packaging. Although various people (including myself) have done a bit of work at integrating Apps Script with Github, it’s always going to be a bit of a hack job. Not only would this improve usability, it would also give a lot more visibility to the useful scripts and libraries that many are more than willing to make public.
  • The IDE still kinda sucks. There’s limited JSDOC support and autocomplete and the debugger is fairly useless compared to what we’ve come to expect in other environments.  What’s more, development on the Chrome Dev Editor, which many of us used  for the bulk of coding, has now been stopped – I assume to be deprecated at some point. I had hopes that this might become the editor for Apps Script. From what I can tell by rummaging around in the Chrome developer tools while its running, the IDE is based on an open source editor called Code Mirror. But Code Mirror is at version 5, and the IDE uses version 2 from a few years ago. Even bumping it up to the modern version would make a world of difference.
  • Google Sites is old, and can no longer even be monetized. The ability to host images (and even sites) on Drive will be withdrawn later this year (here’s how to migrate to Google Cloud Storage if this affects you). But be careful. If you do still have the original Sites Adsense gadgets on your site, and you want to automate the migration of hosted images using Apps Script by modifying and rewriting the pages’ HTML, these Adsense gadgets will be stripped out of the code you write back. So your choice is to remove any remaining monetization gadgets, or update the pages manually. So again this year, there is no news about a better Sites capability (or perhaps even that this one will be deprecated), no improvements to the existing service, and a dilemma for those running significant public sites on that platform.
  • CORS is still not supported in the apps script environment, which means that the execution API and the Content service can’t be used to their full extent because of Cross Origin Resource sharing limitations.

Most of these bucket list items are about developer efficiency and reuse, but if Apps Script developers are not happy with their development environment, it doesn’t matter how good the Apps Script services are – there will be few people creating content.

Having said that, there are some good things on the horizon for Apps Script in the coming year. What do you predict/hope the highlights of ‘2016 – a year in Apps Script’ will be ?

A few notes on the community

The apps script community continues to expand – if you haven’t yet, I encourage you to join and participate to continue this discussion.

Apps Script and Drive technologies have now been combined and are represented in the Google Developer Experts group by these 13 individuals, so we’ve seen a few new additions in 2015.

Desktop Liberation is a site mainly about Apps Script, Google APIS and Microsoft Office. Of about 3m pageviews to date between it and this blog, about half are still about Microsoft technologies although I don’t write too much about that nowadays.

My new book Going Gas – from VBA to Google Apps Script, which came out in the US last month and should be available worldwide by the end of March, is available from O’Reilly, Amazon and any other bookshop.

Author: brucemcp

Leave a Reply

Your email address will not be published. Required fields are marked *