ここにコードがあります。回答者がフォームを提出したときにトリガーを使用するので、私はデバッグできません。Googleアプリスクリプトでドキュメントを保存するにはどうすればよいですか?
// This code opens the doc and names it what you wanted it named above. It also appends any other language to the title that you wish. My sample below will title each document as docName + 'for' + Lname or (OA Graduate Assistant Application for Last Name of user).
var copyId = DriveApp.getFileById(docTemplate)
.makeCopy(docName+' for '+ Lname)
.getId();
// Open the temporary document
var copyDoc = DocumentApp.openById(copyId);
// Get the document’s body section
var copyBody = copyDoc.getActiveSection();
//code that makes edits
copyBody.replaceText('keyTimestamp', Timestamp);
copyBody.replaceText('keyPemail', Pemail);
//define the source folder to save the file in
var dir = DriveApp.getFolderById(folderid);
//add this file to the source folder
dir.addFile(copyDoc);
copyDoc.saveAndClose();
指定したフォルダとGoogleドライブ全体にファイルが保存されていません。どうしたの?すべての変数が正しく定義されています(私はvarステートメントを省略しました)。
有効なドライブファイルIDである[getFileById(id)](https://developers.google.com/apps-script/reference/drive/drive-app#getfilebyidid)に値が渡されていますか? – noogui
はいファイルが有効です – NoMoreErrors
この問題をデバッグする方法はありますか? – NoMoreErrors