我的驱动器有一个文件夹列表。其中一些文件夹与我共享。例如:
/images
logo.PNG
mimdmap.jpg
/projects (shared)
/webproject1
doc1.doc
finance_2017.xlsx
我想创建一个函数如下:
function listFolderFiles(path, file, callback){
var founded = false;
//google drive validate if entire folder exist
var pathCheck = ?
If(pathCheck == false){
return callback (false);
}else{
//google drive script to return files list object
var filesList = ?
//loop to find file
for(var i=0;i<filesList.size();i++){
if(filesList[0].name == file){
founded = true;
}
}
return callback(founded)
}
listFolderFiles("/projects/webproject1", "doc1.doc", function (ret){
Looger.log(ret);
});