【发布时间】:2016-10-24 20:44:40
【问题描述】:
如何打开一个应用脚本脚本文件,复制其内容,然后用复制的内容替换同一帐户中另一个应用脚本脚本文件的内容?
到目前为止我所拥有的:
// open file to copy from
var file = DriveApp.getFileById(fileIdToCopyFrom);
// copy file contents?
var copiedContents = file.getAs('text/plain'); // generates error: Converting from application/vnd.google-apps.script to application/pdf is not supported.
// replace file contents with copied content
DriveApp.getFileById(fileIdToCopyTo).setContent(copiedContents);
【问题讨论】:
标签: google-apps-script google-api google-drive-api google-apps