More Apps Script APIs and Features

Tuesday, February 25, 2014 | 9:35 AM

Labels:

Developers like you have built amazing scripts with Apps Script, and we want to make Apps Script even more useful. We've been working hard to add a variety of new APIs and features in Google Apps Script. Today, we're ready to share a few of them with you.


New in Document service: named ranges, bookmarks, setting cursor or selection, and undo

Named ranges are a popular feature of the Spreadsheet service; and now, you’ll be able to do something similar in the Document service. With named ranges, your scripts can tag a section of a Google Doc for later reference. For example, a bibliography script could set a named range on every citation in a document, then easily update the citations in the future.


You can use a similar API to manage bookmarks, too. Unlike named ranges, bookmarks are visible to the user and allow you to link to a particular place in a document.

Also for Google Docs, we've added the server-side methods setCursor(position) and setSelection(range) to change the user's cursor position or active selection, plus a client-side method, google.script.host.editor.focus(), which switches the browser focus from a sidebar or dialog back to the document.

Oh, and hey: the Undo command in Google Docs can now revert changes made by a script.


New in HTML service: NATIVE mode by default

If you've used HTML service much, you'll know that the Caja security sandbox has two modes. NATIVE mode imposes fewer restrictions than EMULATED mode and generally runs faster. As of today, NATIVE is now the default if you have not specified which mode your script should use. In a few edge cases, this may affect how existing web apps operate; if so, simply append .setSandboxMode(HtmlService.SandboxMode.EMULATED) to your HtmlOutput object to restore the old behavior.


Revised Properties service

In preparation for future improvements to Apps Script, we've revamped script properties and user properties, combining them into a unified Properties service and adding the notion of document properties, which are (surprise!) specific to a particular document, but shared among all collaborators. The biggest change is that user properties are no longer shared between scripts, but our guide to the Properties service provides all the details. As part of the change, the old ScriptProperties and UserProperties services have been deprecated, although they will continue to function in existing scripts until a sunset date is announced.


Deprecation of Finance service

We’re excited to bring you these new tools. With these new additions, we have also deprecated Finance service. It will remain available for the next six months but will be turned off on September 26, 2014.


Saurabh Gupta   profile | twitter | blog

As the product manager for Google Apps Script, Saurabh is responsible for Apps Script’s overall vision and direction.

5 comments:

foooooooo en said...

This comment has been removed by the author.

foooooooo en said...

Please don't deprecate a Finance service.

We belive "Experimental!"marks.
If you deprecate the steady state service easily,We can't use new servicies for application dev.

Policy is different?
Utilization is low?

Please look at the long term.

psg said...

Why is the finance service being deprecated and will this affect any google finance functions on Google spreadsheets?

Dominic Dodge said...

New in HTML service: NATIVE mode by default:

«In a few edge cases, this may affect how existing web apps operate»

I'm sorry to break this news to you but I firmly believe that you've underestimated that one! Lots and lots of script have been broken by this change and I saw numerous issues being logged on the issue tracker and questions asked on StackExchange. The crowd did not anticipate this and, apparently, no one read the blog post or realized the impact.

May I suggest making such changes in a more structured and communicative manner in the future?

Thanks!

Rishi Arora said...

Salesforce developer always try to make the apps more friendly and unique whenever using script or any other.