Created
July 27, 2018 17:22
-
-
Save cromwellryan/7db57b19176fe8ba40c2b39c2b922d8b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //This script will allow you to make a whole lot of | |
| //copies of a document in your Google Drive. | |
| //If the original is in a folder, then the copies will be made | |
| //in the same folder | |
| //be careful of what you change. Each semicolon is very important. | |
| function copyDocs() { | |
| var activeDocument = DocumentApp.getActiveDocument(); | |
| var fileId = activeDocument.getId(); | |
| var file = DriveApp.getFileById(fileId); | |
| var people = [ | |
| 'Name 1', | |
| 'Name 2' //keep going | |
| ]; | |
| var originalName = file.getName(); | |
| people.forEach( function (personName) { | |
| file.makeCopy(originalName + ' ' + personName); | |
| }); | |
| } | |
| //When you have changed the nubmer of copies and the document ID in the script, | |
| //you will click on the save icon and then go to the Run menu and choose copyDocs. | |
| //Authorize the script and copies will be made to your drive. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment