I'm duplicating spreadsheets based on a template file with attached appsscript project. Below you can see the basic code. This works perfectly for the spreadsheets, but the name of the appsscript project remains the same as the template file. Which is a problem, as I can't distinguish them anymore. I will have hundreds of duplicates in the end.
Is there a way to set the appsscript project name on duplication?
Thank you in advance!
function copyTemplatev2(filename, sheetID) {
var ss = SpreadsheetApp.openById(sheetID);
//Make a copy of the template file
var copy = DriveApp.getFileById(sheetID).makeCopy()
var documentId = copy.getId();
// Set permissions
copy.setSharing(DriveApp.Access.ANYONE, DriveApp.Permission.EDIT)
//Rename the copied file
DriveApp.getFileById(documentId).setName(filename);
}