Showing posts with label more. Show all posts
Showing posts with label more. Show all posts

Wednesday, March 11, 2015

More Apps Script APIs and Features

Developers like you have built amazing scripts with Apps Script, and we want to make Apps Script even more useful. Weve been working hard to add a variety of new APIs and features in Google Apps Script. Today, were 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, weve added the server-side methods setCursor(position) and setSelection(range) to change the users 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 youve used HTML service much, youll 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, weve 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.

Monday, March 9, 2015

Even more Image Metadata for the Google Drive SDK

Lots of photographers, both professionals and amateurs, have started using Google Drive to store their photos online. We recently launched new features such as a way to quickly preview files and today I wanted to share more details about the image media metadata capabilities of the Drive SDK.

All digital cameras add some Exif information to the photos they take, and we exposed an initial set of Exif fields via the Google Drive API at the end of 2012. That set of metadata has now been expanded to include 9 new fields, such as the sensor type or the metering mode.

For instance, take a look at this recently taken photo:

Photo credit: Claudio Cherubino

What follows is the image media metadata as returned by the Drive API (in bold the new fields):


"imageMediaMetadata": {
"width": 2048,
"height": 1536,
"rotation": 0,
"date": "2013:02:18 12:51:51",
"cameraMake": "Panasonic",
"cameraModel": "DMC-GF2",
"exposureTime": 0.0025,
"aperture": 7.1,
"flashUsed": false,
"focalLength": 14.0,
"isoSpeed": 100,
"meteringMode": "Pattern",
"sensor": "One-chip color area",
"exposureMode": "Auto",
"colorSpace": "sRGB",
"whiteBalance": "Auto",
"exposureBias": 0.0,
"maxApertureValue": 3.6289062

}

You might have noticed that a number of fields have been added to the response while others (“subjectDistance” and “lens”) were not returned. This is expected as the camera doesn’t have to populate all Exif fields and in that case the corresponding properties will simply not be included in the API response.

For more information and to check the description of all metadata fields returned by the API, check the Files resource Reference Guide. If you have technical questions, please post them on Stack Overflow, my team monitors the google-drive-sdk tag and is happy to help.

Claudio Cherubino   profile | twitter | blog

Claudio is an engineer in the Google Drive Developer Relations team. Prior to Google, he worked as software developer, technology evangelist, community manager, consultant, technical translator and has contributed to many open-source projects. His current interests include Google APIs, new technologies and coffee.