2013-04-12 95 views
1

我有一個GApp哪個草稿構建一個新的GDrive電子表格。我出現在我的根目錄中。 我想將新的SS放置在特定的文件夾中。谷歌驅動器腳本文件夾位置

我似乎無法找到如何做到這一點。

回答

1

API Reference

// This example creates a new file and adds it to a folder 
// Note: This can also be used on a folder to add it to another folder 
var file = DocsList.createFile('my test file', 'test file contents'); 
var folder = DocsList.createFolder('My Test Folder'); 
file.addToFolder(folder); 
Logger.log(file.getParents()[0].getName()); // logs 'My Test Folder' 

剛擡起頭,這取決於你如何創建電子表格,你可能有困難,DocumentApp.create()file似乎是不同的對象類型。不過不用擔心,file具有可參考here

希望幫助自己的創作方法(DocsList.createFile(name, contents))。

相關問題