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);