title: How to create a folder if it doesn't exist?
body: <p>I'm trying to create a folder if it doesn't exist, but the code creates a new folder every time I run it. I don´t know if my code is right. </p>
  
  <p>Here is my code:</p>
  
  <pre><code>var alumnopath = DocsList.getFolderById ('0Bzgw8SlR34pUbFl5a2tzU2F0SUk');
  var alumno2 = alumno.toString();
  Logger.log(alumno2);
  try {
    var folderalumno =  alumnopath.getFolder(alumno2);
    if (folderalumno == undefined){
      var folderalumno =  alumnopath.createFolder(alumno2);
    }
    else {
      var folderalumno =  alumnopath.getFolder(alumno2);
    }
  }
  catch(e) {
    var folderalumno =  alumnopath.createFolder(alumno2);
  }
  folderalumno.createFile(pdf.getAs('application/pdf')).rename(  alumno +  " , " + fechafor);
  </code></pre>
  
  <p>Thanks for your help!!</p>