The Drive SDK allows apps to store all kinds of files and file-like items in user-managed cloud storage. Files can be standard document formats like PDF, images, video & audio clips, or even your proprietary application data files. Storing files in Drive makes it easy for users to organize, search, and securely share them with their coworkers, friends, or family.
However, some applications work better with document or application data stored in a database. For example, let’s imagine a modern, web-based project management tool that provides lots of awesome features via data objects that are assembled dynamically at runtime for presentation to the user. In such cases, there is no single file to store all the data that comprises the project -- though there is of course a named “file” item that users will want to save and list in their Drive. Drive applications like this can create file-like entries called shortcuts that allow users to organize, access, and share items as if they were files stored in Drive.
Creating a shortcut is not much different than creating a regular file. Just set the MIME type to application/vnd.google-apps.drive-sdk, and make sure you don’t upload any actual content in the call to files.insert. Here’s an example of creating a shortcut using Python:
application/vnd.google-apps.drive-sdk
files.insert
shortcut = { 'title': 'My project plan', 'mimetype': 'application/vnd.google-apps.drive-sdk', 'description': 'Project plan for the launch of our new product!' } file = service.files().insert(body=shortcut).execute() key = file['id'] # Key to use when re-opening shortcuts
For examples in other supported languages, see the Drive SDK documentation.
Opening shortcuts in Drive always launches the application that created them. Shortcuts can even be synchronized to the desktop. Opening a shortcut from the desktop will launch the application that created it in a new browser tab.
Shortcuts require special consideration when it comes to sharing and security. Since the actual content is not stored in Drive, applications are responsible for enforcing permissions and ensuring that only authorized users are allowed to read or update content. Follow these best practices when working with shortcuts:
files.get
userPermission
reader
commenter
Honoring permissions not only ensures the protection of user data, but also provides a consistent user experience and added value to Drive applications. Users should be able to safely share an item in Drive without worrying about the particular implementation details of the application that created it.
If you have any questions about shortcuts, don’t hesitate to ask us on our Stack Overflow tag, google-drive-sdk
Over the past few years we've seen lots of Apps Script adoption within the EDU community. Educators need lightweight systems that integrate with the Google Apps they already use. Empowered by a cloud-hosted and simple to use platform, non-programmers have been able to create powerful scripts that have a real impact on the lives of their students. In honor of World Teachers' Day we're highlighting some popular scripts educators have created and other materials teachers can use to get started.
Earlier this year we sat down with Andrew Stillman, Program Officer for Digital Instruction at New Visions for Public Schools and co-founder of youpd.org. We discussed about how he uses Apps Script to build solutions for the New York City school system. He's the author of many popular scripts in the Script Gallery, including formMule, doctopus, and autocrat, which he uses to create powerful systems that tie together Google Forms, Spreadsheets, Docs and GMail in a way that teachers and administrators can maintain and enhance.
Flubaroo is another popular script among teachers, as it extends the usability of Google Forms for online assignments. After students have submitted their responses this script scores their answers against an answer key, generates histograms of the class's performance, and sends out personalized emails to each student with their grades.
Even more exciting, however, is that teachers have been writing their own scripts to solve problems and make their lives easier. For example, Adelphi University professor Lee Stemkoski wrote a small script that he uses to populate a Google Calendar with the topics for each lecture he'll give during the semester. In just 30 lines of code he was able to complete a long, monotonous task with the click of a button.
Teachers looking to get a better idea of how Apps Script works and what it can be used for should watch our video Google Apps EDU Fireside Chat: An Introduction to Apps Script. In it we cover the basic functionality and use cases supported, and even do some live coding to show how easy it is to get started. More than 20 million students, faculty and staff worldwide use Google Apps for Education, so if you build something interesting and worth sharing, consider publishing to the Chrome Web Store.
Apps Script developers that wished to share their work with a larger audience have traditionally turned to the Script Gallery, which allows other users to copy and install the script into their own spreadsheets. While appropriate for custom functions and spreadsheet extensions, it didn't fit well when distributing more complex functionality and apps.
In this blog post we'll be highlighting a newer way to distribute your scripts: deploying them as a web app and publishing them to the Chrome Web Store. Compared to the Script Gallery, the Chrome Web Store has some distinct advantages for developers:
Looking through the Script Gallery we believe there are many scripts that would be a great fit for the Chrome Web Store and would benefit from the advantages listed above. Some aspects of a good candidate script are:
A great example of such a script is Gmail Meter, which was first launched in the Script Gallery but has since been published to Chrome Web Store. Now users can install and run the script without needing to create a spreadsheet, see script code, or set up triggers. It may take a little work to update a spreadsheet-based script to use the web app model, and some common tasks are:
Publishing to the Chrome Web Store only takes a few clicks, and we provide instructions for the process in our documentation. We hope that you are inspired to take your scripts to the next level, and if you have any questions along the way feel free to reach out to us on StackOverflow or Google+.
At Google I/O in June, we launched two new features that made it easier to build and distribute web apps with Google Apps Script. First, we added the ability to deploy web apps that run as the user. Second, we added simple integration for publishing web apps that you’ve built with Apps Script to the Chrome Web Store.
Recently we’ve come across some new and useful web apps that developers have built using Apps Script and published in the Chrome Web Store. In this blog post, we’d like to highlight a few of those.
To try these and other web apps built using Apps Script, just visit the Chrome Web Store. If you’re interested in building and deploying your own web apps with Apps Script, see our documentation for web apps and publishing to the Chrome Web Store.
Hello Los Angeles! Following on the heels of our hackathon in Austin, Texas, we’ve decided that it’s time to bring the party to the City of Angels in sunny southern California. We’ll be hosting an Apps Script hackathon in our recently opened Los Angeles office on Tuesday, November 13th, 2012 between the hours of 2-8pm Pacific Time. We invite anyone that either uses or wants to learn about Google Apps Script to come and meet the team!
We’ll start off with a quick introduction to Apps Script followed by a short tutorial. At that point, we’ll break off into groups or individual work to either build apps or work through tutorials - both are fine, and you’ll have direct access to the Apps Script team to help you with any questions or ideas. We’ll provide food, drinks, power and wifi - you just bring your laptop, your creativity, and your appetite for code! Check out the detailed Google Sites page, RSVP once you know you can make it, and tell your friends about the event!
Official event page: https://sites.google.com/site/appsscripthackathonlosangeles
Hope to see you there!
- Ikai
Did you know you can write a complete Google Drive App with JavaScript that runs completely in the web browser? You can! Your browser-based application, including Chrome extensions, can take advantage of our client library, or just use CORS requests to the API.
Your app can support all the functionality of the Drive API, including uploading files, downloading files, tracking changes, listing files and managing revisions. Also you can take advantage of our user interface components that make opening and sharing files easy.
We are really keen to offer first-class support to browser-based applications, so we have added JavaScript snippets to all our API reference documentation. Please let us know how we are doing by posting to Stack Overflow.
Want to try it out? Check out our Javascript Quickstart Guide, which helps you get your application up and running in five minutes or so.
With the arrival of the new Google Drive API v2, we are deprecating the Google Documents List API v3. We are confident that the Google Drive API covers all the functionality of the Documents List API, in addition to adding many improvements, including Drive UI Integration, a finer grained security model, and a better client library experience.
What does this mean for your app?
The Documents List API v3 will remain in action for more than a year, as per our deprecation policy, so there’s no rush, but we encourage you to migrate your code to the new platform. Documentation is available with samples in multiple languages and a migration guide outlining some of the major transition points.
If you have any questions or issues, please ask them on StackOverflow.com, where our team is waiting to hear from you.