title: Google docs script create a file in a folder
body: <p>I wrote a code to create a new file this file I put a page of my spreadsheet after I move it to another folder, the problem is on the move it. I've tried to makecopy function and addtofolder but neither worked all returned an error.</p>
  
  <p>this is my code:</p>
  
  <pre><code>function pasta(){
    var fonte = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Sheet1');
    var root = DocsList.getRootFolder()
    var base = DriveApp.getFoldersByName('Violino').next();
    var pasta1 = base.createFolder('Subfolder2');
    var destino = SpreadsheetApp.create("teste");
    var destinoF = DocsList.getFileById(destino.getId());
    fonte.copyTo(destino);
    destinoF.makeCopy("x",pasta1);
    destinoF.removeFromFolder(root);
    //Browser.msgBox(); 
  }
  </code></pre>