After creating a function in Google Scripts to clear my trashed files, I ran it only to find that nothing happened. There were no logs generated either.
function clearTrashed() {
var files2 = DriveApp.getFiles();
while (files2.hasNext()) {
var currentFile2 = files2.next();
if (currentFile2.isTrashed()) {
Drive.Files.remove(currentFile2.getId());
Logger.log("Deleted file: " + currentFile2.getName());
}
}
}
Despite having the Drive API enabled in both my Google Developers Console and advanced google services, the function doesn't detect any trashed files as there are no logs being recorded for them. Unfortunately, I am unable to add the tag google-script due to insufficient reputation points.