我编写了一个容器绑定脚本,现在想通过将代码插入到 Google Docs 文件中来生成报告。问题是从脚本编辑器复制和粘贴,代码不再着色或缩进。我需要你的帮助,因为我不知道如何把它做好。我有这个代码:
createAndSendDocument() {
// Create a new Google Doc named 'Hello, world!'
var doc = DocumentApp.create('Hello, world!');
// Access the body of the document, then add a paragraph.
doc.getBody().appendParagraph('This document was created by Google Apps Script.');
// Get the URL of the document.
var url = doc.getUrl(); // Get the email address of the active user - that's you.
var email = Session.getActiveUser().getEmail();
}