I'd like to copy a Google Docs document and add text to the copy. This is my code:
function main() {
var template = DriveApp.getFileById(TEMPLATE_DOC_ID);
var copy = template.makeCopy('copied file');
var form = DocumentApp.openById(copy.getId());
form.insertText(0, 'Inserted text.\n');
}
When I run main(), I get the following error: TypeError: Cannot find function insertText in object Document. (line 5, file "Code")