Skip to content

Instantly share code, notes, and snippets.

@geektutor
Created October 11, 2024 11:59
Show Gist options
  • Save geektutor/5c8933bc1b14b6e40387faa582e033ca to your computer and use it in GitHub Desktop.
Save geektutor/5c8933bc1b14b6e40387faa582e033ca to your computer and use it in GitHub Desktop.
Make a copy of a docs
//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
function copyDocs() {
for(i=0; i<6; i++){ //change the number 30 to however many copies you want.
//open the document in Google Drive that you want to copy.
//Look at the URL, there is a string of weird letters and numbers that is the document ID
//Copy the document ID and REPLACE it in the line of code below.
//Notice there are single quotations around the document ID, that is important!
var drive=DriveApp.getFileById('1izHA21LAMpBJeKJfXkDsH8Ju09MjDFjWHHsJVODibtE');
drive.makeCopy();
}
}
// 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