title: How to search for Folder using Google Apps Scripts
body: <p>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.</p>
  
  <pre><code>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");
    }
  }
  </code></pre>
  
  <p>The documentation states it returns a FileIterator but refers to the Google Drive SDK for further information 
  <a href="https://developers.google.com/apps-script/reference/drive/drive-app#searchFiles(String)" rel="nofollow">https://developers.google.com/apps-script/reference/drive/drive-app#searchFiles(String)</a></p>
  
  <p>In the search parameters here, we can specify if it's a folder or not
  <a href="https://developers.google.com/drive/search-parameters" rel="nofollow">https://developers.google.com/drive/search-parameters</a></p>
  
  <p>Are there options for searching for a folder name?</p>