javascript - Google Drive File Iterator within Folder iterator -
i trying write code file iterator through google scripts goes through particular folder in google drive, searching files (within subfolders) of particular name.
my current iterator bring files of name if in immediate folder, not in subfolders.
var folder = driveapp.getfolderbyid('folderid') var files = folder.getfilesbyname("file name"); while (files.hasnext()) { var file = files.next();
is there way make iterator sift through subfolders find files given name?
from pure comp sci 101 perspective, need put code function call recursively descend folder hierarchy.
however ... don't that. ...
fetch of folders in single call , build memory model of hierarchy. use model create list of candidate folder ids, search file name, , compare parent ids of matches list of candidate folder ids.
Comments
Post a Comment