My question is simple and described in the Title.
I would like to write a script in App Script, that will search and list all the files in my Drive (Folders and Subfolders) that labels/restricted is false.
I could fetch all files and check one by one, but this is very time consuming script.
Thank you in advance.
UPDATE:
To be more specific I use the Script Editor in a Google Spreadsheet. I have enabled the Drive API in Script Editor in case I need it.
A simple search I use to find files that the modified date in one hour ago is the following:
var today = new Date();
var oneHourAgo = new Date(today.getTime() - 1 * 1 * 60 * 60 * 1000);
var startTime = oneHourAgo.toISOString();
var search = '(trashed = true or trashed = false) and (modifiedDate > "' + startTime + '")';
var files = DriveApp.searchFiles(search);
Now, I would like to search all the files in Drive that has the property label.restricted equals false.
DriveApp.searchFiles("properties has { key='label.restricted' and value='false' }");
– a-changeDriveApp.searchFiles("properties has { key='label.restricted' and value='false' }");
– Loukas Nikolaidis