Recent Updates in Google Apps Script
GDG-NYC Jan 2014
Who are you?
What is Apps Script again?
“Google Apps Script is a scripting language based on JavaScript that lets you do new and cool things with Google Apps like Docs, Sheets, 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.”
Meaning What?
Apps Script is versatile. Among other things, you can:
https://developers.google.com/apps-script/overview
So what is new?
Two major changes recently:
http://googleappsdeveloper.blogspot.com/2013/12/more-google-services-available-in-apps.html
More advanced services
Built in services: GMail, Docs, Sheets
Advanced services: Analytics, Tasks
More JavaScript-y API
Old way:
function insertTimelineItem() {
var timelineItem = Mirror.newTimelineItem();
timelineItem.text = 'Hello world!';
var notificationConfig = Mirror.newNotificationConfig();
notificationConfig.level = 'AUDIO_ONLY';
var menuItem = Mirror.newMenuItem();
menuItem.action = 'REPLY';
timelineItem.notification = notificationConfig;
timelineItem.menuItems = [menuItem];
Mirror.Timeline.insert(timelineItem);
}
Pros: Editor syntactical support. Matches Java API.
Cons: Tedious. Matches Java API.
More JavaScript-y API
New way:
function insertTimelineItem() {
var timelineItem = {
text: 'Hello world!',
notification: {level:'DEFAULT'},
menu: [{action:'REPLY'}]
}
Mirror.Timeline.insert(timelineItem);
}
Pros: Terse.
Cons: Terse. No editor support.
(But you can mix the two styles if you want.)
Questions?
Google Apps Script