I'm trying to delete some files from my drive using this:
function deleteFiles(){
var files = DriveApp.searchFiles('title:720p');
Logger.log(files);
//Logger.log(files.next().getName);
while (files.hasNext()) {
// files.next().setTrashed(true);
//Logger.log(files.next().getName());
Logger.log('hola');
}
}
But i get Error: Invalid argument:q
in all commented lines, even in the while loop. The first logger shows Folder Iterator, so every should be fine...
Files exist! and all have different names, but they have in common "720p" in their names.
Besides, and i haven't been able to implement this yet, i only need to delete these files that are only in one specific folder.