is there a parameter in GDrive to start a search with "DriveApp.searchFiles". After the first e.g. 10 hits the command stop the searching.
Currently I can only manage to search for all hits, but this takes too long.
Greetings
I try this GScript:
function listAllFiles() {
var MyAccount = Session.getActiveUser().getEmail();
var files = DriveApp.searchFiles('title contains "GutenTag" and "' + MyAccount + '" in owners');
while (files.hasNext()) {
var file = files.next();
Logger.log(file.getName());
}
}
Alternative Method [update]
If you would rather not use looping, as this can slow down the
DriveApp.searchFilesfunction in your actual environment, you may want to try using the Google Drive API Advanced service list method and include apageSizequery parameter in the API call request. Here is a sample script:[Updated]
Prerequisites:
Add the Drive API Advance Service in your Services section on the Apps Script Editor:
Demo