title: get folder by name driveapp
body: <p>I'm trying to put attachments in my drive folders automatically. The script/loop runs fine until there are similar foldernames to look for. The code only gives the first one. So when i have two drive folders one named "Test" en the other named "Test new" and the input for 'driveFolder' in de code is "Test new" it puts the attachment in the folder "Test". Can anyone help me with getting the folder with the exact foldername? (The input for 'driveFolder is coming from a sheet with all the foldernames) Below is the (part of) the code i use:</p>
  
  <pre><code>var folders = DriveApp.getFoldersByName(driveFolder); 
  var  folder = folders.hasNext() ? folders.next() : DriveApp.createFolder(folder_name);
  </code></pre>
  
  <p>Thanks in advance</p>