How to delete a File in Google Drive?

后端 未结 5 690
既然无缘
既然无缘 2020-12-31 03:57

How do I write a Google Apps Script that deletes files?

This finds files:

var ExistingFiles = DocsList.find(fileName);

But Do

5条回答
  •  情书的邮戳
    2020-12-31 04:34

    Though the The service DocsList is now deprecated, as from the Class Folder references, the settrashed method is still valid:

    https://developers.google.com/apps-script/reference/drive/folder#settrashedtrashed

    So should work simply this:

    ExistingFiles.settrashed(true);
    

提交回复
热议问题