I'm making apps script to find files that don't contain the names "Done" and "InProgress".
The script that I have created is like this:
function testSearch(){
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
var parentFolder = DriveApp.getFolderById('1gr0RIGIt0AEzEqIxJigGxYlxQGy8yLqp')
var allFile = parentFolder.getFiles()
var filter = parentFolder.searchFiles('fullText not contains "Done"' && 'fullText not contains "InProgress"');
var cnt = 0;
while (allFile.hasNext()) {
var filter = allFile.next();
cnt++;
var data = [
filter.getName(),
filter.getUrl(),
];
sheet.appendRow(data);
}
}
Best Answer
Done
andInProgress
.If my understanding is correct, how about this modifiaction?
Modification point:
not title contains 'Done' and not title contains 'InProgress'
.Modified script:
Note:
cnt
in your script.Reference:
title
.If I misunderstood your question and this was not the result you want, I apologize.
Edit:
When you want to retrieve files in the subfolders, please use the following script.
Sample script: