Google I/O 2013 - Integrate Google Drive with Google Apps Script

Google for Developers · 8K views · 2013 · 40:41

Open on YouTube

Web developmentSoftware (other)talkdated

Why Stack Overflow recommends it

Stack Overflow users link it when asking how to add Apps Script actions to Drive menus, or how DriveApp relates to the older DocsList service.

Recommended by 2 people across 2 different months, 2013 to 2015.

What it is

A 40-minute Google I/O 2013 session by Arun Nagarajan and John McGowan on combining the Google Drive SDK with Google Apps Script. It shows how to add custom Create and Open With menu entries in Drive and how to access files and folders programmatically via Apps Script.

What people said

Recommends Peter · 2013-05 · Stack Overflow · on “Add a menu to Google Drive”

Yes, it's quite new and advanced (and neat) but in a nutshell you would: Write an Apps Script using DriveApp and publish it as a web app. Setup a new Drive SDK project on the developers console and point an Open URL action to the url from 1. This allows you to extend the context menu with your own "Expiring share" style option for a selected file(s). There is a fantastic Google I/O 2013 session that covers this entire process: Google I/O 2013 - Integrate Google Drive with Google Apps Script [this video] . When you watch it you'll see it starts out with a demo. The technical details diving into the above steps starts at 13:10.

Recommends Greg · 2013-06 · Stack Overflow · on “Creating a Google-Drive app, how to get started?”

This video [this video] is about using Apps Scripts in combo with the Drive interface. About supported file types, I'm not really clear on the question. Are you trying to build a viewer with Apps Scripts that has edit capabilities for more file types than the native Drive editor/viewer?

Cites Peter · 2013-05 · Stack Overflow · on “With the DriveApp FileIterator, how do I work with sets larger than I can process within the limited time you have for processing?”

The new FileIterator [LINK] in the DriveApp [LINK] service lets you work through files in a very streamlined way. // Process all files in the user's Drive. var files = DriveApp.getFiles(); while (files.hasNext()) { var file = files.next(); myProcessingFunction(file); } In DocsList [LINK] which apparently " is now deprecated [this video] ", the get*ForPaging [LINK] methods allow retrieval of large sets by providing a Token to paginate with. You can store the token in say a script property and use it to start at the correct place at later invocations. How do you do this in DriveApp ? How do you handle the case where you can't iterate over all the files you need to during the limited time you have f

Cites user2480706 · 2013-06 · Stack Overflow · on “Apps script integrate with Google Drive”

I'd like to integrate google apps script with drive, specifically add my app script app to the 'create' menu in the drive, like this: [LINK] It is explained a little bit in this IO video but I don't quite get the part about adding to menu. [this video] Thanks!!!

Cites dev · 2013-11 · Stack Overflow · on “Migrating from DocsList to DriveApp?”

Good question... I'm not sure why but I assumed as DocsList was 'Experimental!' that it would be replacing DriveApp. Found this link to a discussion at Google I/O [this video] where @ArunNagarajan recommends switching over. Your example seems to be the correct way of going about it but I can see this taking longer and approaching the maximum execution time, which is why I assume `getContinuationToken()` [LINK] ) was added. I too will miss the `getFolder(path)` method.

Cites Tamás · 2015-04 · Stack Overflow · on “Calling apps script function from drive UI”

I just implemented a function which operates on a File object in Google Drive(*). Long story short: the function doSomething(file) { ... } exists (in a standalone Google Apps Script) and is well tested. I want to call this from the Drive UI, e.g. using context menu -> Open With ... (but really any sensible means would be OK). Is there a straightforward way to achieve this? I prefer not to go through 'registering an app in the Chrome store' whole shebang when all I need is a glorified macro for myself. I just finished listening to [this video] which comes closest so far but it seems to skip the technical details of exactly what I need. (*) There is a rather frustrating repetitive per-file workflow