Have I made a simple mistake or can we not search for folders using .searchFiles method on DriveApp? I have a more complex search parameter but I've simplified it for this example.
function getFolders()
{
var searchParams = 'mimeType = "application/vnd.google-apps.folder"';
var searchFiles = DriveApp.searchFiles(searchParams);
if (searchFiles.hasNext())
{
// Do Something
}
else
{
// Error
Logger.log("No folders found");
}
}
The documentation states it returns a FileIterator but refers to the Google Drive SDK for further information https://developers.google.com/apps-script/reference/drive/drive-app#searchFiles(String)
In the search parameters here, we can specify if it's a folder or not https://developers.google.com/drive/search-parameters
Are there options for searching for a folder name?