1
A
回答
1
// 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)
)。
相關問題
- 1. 谷歌腳本應用程序列表驅動器文件夾
- 2. 使用谷歌腳本下載文件到谷歌驅動器
- 3. 谷歌驅動器共享文件夾
- 4. 谷歌驅動器文件夾信息
- 5. 谷歌腳本 - 複製驅動程序文件夾錯誤
- 6. 如何通過谷歌腳本更新谷歌驅動器文本文件?
- 7. PNG覆蓋腳本(谷歌驅動器)
- 8. 谷歌驅動器根位置
- 9. 谷歌驅動器:移動文件到文件夾
- 10. 谷歌腳本文件的文件夾
- 11. 谷歌腳本:從谷歌驅動器列表文件從工作表範圍獲取文件夾ID
- 12. 在谷歌文件夾中按名稱搜索文件使用谷歌腳本的驅動器
- 13. 使用谷歌apss腳本上傳文件到驅動器
- 14. 谷歌腳本,得到一個驅動器文件url
- 15. 使用谷歌應用腳本從谷歌驅動器解壓縮文件
- 16. 谷歌腳本從谷歌驅動器中提取文件名URL
- 17. 谷歌驅動器/文件夾中的列表文件
- 18. 子文件夾中的現有文件谷歌驅動器
- 19. 將文件添加到谷歌驅動器中的文件夾
- 20. 谷歌驅動器選取器 - 允許創建文件夾
- 21. 的JavaScript腳本,谷歌的文件夾
- 22. 使用谷歌腳本在谷歌驅動器中合併具有相同名稱的文件夾
- 23. 在谷歌驅動器中創建文件夾與谷歌驅動器紅寶石寶石
- 24. 如何創建文件夾,如果不存在於谷歌驅動器在Android使用谷歌驅動器Api?
- 25. 谷歌應用程序腳本:在谷歌驅動器中導入xlsx文件的腳本
- 26. 谷歌驅動器文件訪問
- 27. 谷歌驅動器SDK共享文件
- 28. 谷歌驅動器sdk上傳文件
- 29. 谷歌驅動器文件下載
- 30. 從谷歌驅動器下載文件