Join Scott Simpson for an in-depth discussion in this video Working with files in Drive, part of Learning Google Apps Script.
- Of course, there's more to Google apps…than Docs and Sheets.…So, let's take a look at Drive,…where you can store files of any type.…The Drive service allows access…to data in Google Drive.…You can use it to list, create,…and remove files and folders;…and to query information about file…types and folder information.…Over in My Drive, I'll upload…a folder of files to work with.…And then I'll switch over to the IDE.…I'll create a new Script file for this.…
I'll call it "Drive," but the name doesn't matter.…I'll set up a variable called, "folders,"…and set it equal to "DriveApp.getFoldersByName."…And I'll pass in, "photos,"…which is the name of the folder I uploaded.…You'll remember that we can have…more than one object with the same name in Drive.…So, this method returns an object…called a "FolderIterator,"…which is a collection of folders.…There's also a "FileIterator" class…that behaves the same way for files.…
If I wanted access to one particular folder,…I could use the "getFolderById" method.…But, I want to show you how iterators work, in this video.…
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