title: How to access to a subFolder with google app script?
body: <p>Im using the script editor in a Google spreadsheet, and I want to create a folder inside a root folder , already created. I've tried to follow the official notice of the API <a href="https://developers.google.com/apps-script/reference/drive/drive-app" rel="nofollow noreferrer">DriveApp</a>, but without success. 
  Here is my code :</p>
  
  <pre><code>function createSubFolder(rootFolder,name){
    DriveApp.getFoldersByName(rootFolder);
    DriveApp.createFolder(name);
  }
  </code></pre>
  
  <p>I've tried also ( following this old <a href="https://stackoverflow.com/questions/11910734/google-apps-script-how-do-i-create-a-file-in-a-folder">post</a> working with the old version of DriveApp : i.e DocsList) :</p>
  
  <pre><code>function createSubFolder(rootFolder,name){
    DriveApp.getFoldersByName(rootFolder).createFolder(name);
  }
  </code></pre>
  
  <p>It seems to be very easy but I don't see where am I wrong.
  Does anyone know the way to do it?</p>
  
  <p>Thanks</p>