I have the problem.
Earlier I had the file for search in my own Google Drive. And the script worked.
function checkInFiles(){
var nameJSON = 'jobToCAF';
var files = DriveApp.searchFiles('title contains "' + nameJSON + '"');
while (files.hasNext()) {
var file = files.next();
Logger.log(file.getName());
}
}
Script searches for files named like 0080076042_jobToCAF.JSON
.
The difference is that now the file is located in shared Google Drive and search doesn't work.
Can you help ?