Can the new DriveApp parameters be used to search a specific folder?
I am looking for a way to search a specific folder using DriveApp in
Google Apps Script. Here is what I have tried:
var folders = DriveApp.getFolderById('searchedFolderId');
var results = folders.searchFolders( "title contains '"+searchTerm+"'");
while (results.hasNext()) {
var folder = results.next();
// do something with search results here
}
Whenever I try this method, I only get the first folder found returned in
the folder iterator even though there are many other results.
I have also tried:
var results = DriveApp.searchFolders( "'searchedFolderId' in parents and
title contains '"+searchTerm+"'");
Now, whenever I try this method, I sometimes get more than one found
folder returned in the folder iterator. Is there a way to search a
specific folder using the DriveApp API...am I doing something wrong?
Thanks!
No comments:
Post a Comment