Join Scott Simpson for an in-depth discussion in this video Understanding script types and permissions, part of Learning Google Apps Script.
- There are two primary categories of scripts, Standalone scripts and Bound scripts. Standalone scripts live as files inside your Google Drive and generally, they run as you. That is, they run as the user currently logged in to the Google account running the script. Think of Standalone scripts like a code file on your computer. You run it. It runs as you. It can access your data and not anyone else's, unless they've shared a particular piece of data with you. The Bound scripts live inside something else, a container, like a Google Doc or a spreadsheet.
They're how you'd add a custom menu or function to a spreadsheet, for example. Bound scripts can be created, viewed, edited, and executed by container owners and editors, which is to say, anyone that owns or can edit the document or spreadsheet the script is inside of. They can only be executed by viewers, which means anyone who isn't an owner or editor, if they're published as a web app. Both, Standalone scripts and Bound scripts, can be converted to a web app. We'll take a look at that process later on.
When a user runs a script for the first time, they'll see an authorization process that will ask permission to access data. On this first dialogue, I'll press "Continue" and on the second dialogue, I can see exactly what this app wants access to. It wants access to view and manage spreadsheets in Drive and also to view and manage the files in Drive. If I click on the little eye icon here, I can see a little bit more detail. I'll go ahead and authorize this app. This permission can be revoked by the user at any time through the Google account dashboard, located at myaccount.google.com Under the "Sign-in & Security" section, click "Connected apps & sites." Then choose, "Manage Apps." Here, I can see the apps connected to my account.
I'll click on "First Project" and I can see what this app has access to. To revoke the access, I'll click "Remove."
First, learn how to use simple scripts to edit documents and spreadsheets, work with files in Drive, and find and send messages in Gmail. Then find out how to add custom functionality to your spreadsheets, and build user interface elements for your scripts, using menus, alerts, and dialogs. Finally, Scott shows how to share your work with others by publishing scripts as web apps.
- What is Google Apps Script?
- Understanding script types
- Logging and debugging your scripts
- Scripting common tasks
- Building custom spreadsheet functions
- Creating add-on functionality such as dialogs and sidebars
- Sharing your script as a web app