【发布时间】:2014-09-10 03:10:34
【问题描述】:
我正在尝试创建对当前 DriveApp 文件对象的引用(即脚本本身的实际 Google Drive 容器)。这是我正在尝试做的事情:
// Assume that thisFile is a FileIterator pointing to THIS file.
// My question in a nutshell: How do I get thisFile?
DriveApp.getFileById( thisFile.getId() );
我想这样做而不是 DriveApp.getFileById(id) 因为我不想对脚本文件的 ID 字符串进行“硬编码”。这样,如果我制作了 Google Apps 脚本项目的副本,我就不必编辑 Code.gs 或脚本属性中的任何内容。有什么建议吗?
【问题讨论】:
标签: javascript google-apps-script google-drive-api