0
如何打開應用程序腳本腳本文件,複製其內容,然後用複製的內容替換同一帳戶中的其他應用程序腳本腳本文件的內容?如何複製一個腳本文件的內容並替換另一個腳本文件的內容?
我有什麼至今:
// 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);