I have a Web App where the script is connected to a Spreadsheet. In the script, I look up a file's ssid from the spreadsheet, I open that file, and then I copy and rename it. The relevant line looks like this:
var copy = SpreadsheetApp.openById(ssid).copy(newName);
That line consistently takes about 5 seconds to execute. Has anyone else experienced this delay? Is there any way to optimize this task? Thank you, Carrie
You might want to try using
DriveApp
instead:Google Documentation - Drive App
You can also designate a different folder to copy the file to. There's no point opening the file to copy it.