Google app
Google Drive
DriveApp lets a script open files by ID, find a named folder with getFoldersByName, and save copies or PDF exports in one known place.
Choose a task using Google DriveStart with an outcome
Tasks that use Google Drive
Choose the result first. The service flow shows what this automation connects.
- Google Drive Save labeled Gmail attachments to Drive
Choose the email threads yourself by adding a Gmail label, then copy their attachments into an existing Drive folder.
- Google Drive Back up a spreadsheet to Drive every week
Run the setup function once. Every Monday morning the script copies the spreadsheet into a Drive folder and puts the date in the copy name. The original is never touched.
- Google Drive Email a Google Doc as a PDF
Give the script the file ID of a Doc. It makes a PDF copy and emails it as an attachment. The Doc itself is not changed.
- Google Drive Fill a Google Doc template from a Sheet row
Each row that has no link yet gets its own copy of your template Doc, with the placeholders swapped for the values in that row. The link to the copy goes back in the last column.
Snippets
Small pieces for Google Drive
Complete functions you can paste and run one at a time.
Object reference
Objects available in Google Drive
Open an object when you need to get it, try a common action, or inspect exact method signatures.
- Object reference Drive folder
A DriveApp.Folder is a container in Google Drive. Find one by name with DriveApp.getFoldersByName(name) or by ID with DriveApp.getFolderById(id).
- Object reference Drive file
A DriveApp.File is one item in Google Drive, such as a Doc, Sheet, or PDF. Open it with DriveApp.getFileById(id) to read its metadata, copy it, or export a PDF.