.
function myFunction() {
//get script id and parent folder
var scriptId=ScriptApp.getScriptId();
var script=DriveApp.getFileById(scriptId);
var parentFolder = script.getParents();
while (parentFolder.hasNext()) {
var folder = parentFolder.next();
Logger.log(folder.getName());
}
//test
var doc = DocumentApp.create('Document Name'),
docFile = DriveApp.getFileById( doc.getId() );
DriveApp.getFolderById(folder.getId()).addFile( docFile );
DriveApp.getRootFolder().removeFile(docFile);
}
.
No comments:
Post a Comment