This question already has an answer here:
- How to update DocsList to DriveApp in my code 2 answers
Since April 20, 2015 the DocsList service "service no longer functions". I have this function this function which used docsList service:
/**
* Duplicates a Google Apps doc
*
* @return a new document with a given name from the orignal
**/
function createDuplicateDocument(sourceId, name) {
var source = DocsList.getFileById(sourceId);
var newFile = source.makeCopy(name);
var targetFolder = DocsList.getFolderById(TARGET_FOLDER);
newFile.addToFolder(targetFolder);
return DocumentApp.openById(newFile.getId());
}
How can I replace the DocsList
service in this createDuplicateDocument
function?