title: Apps Script to Make a Copy of a Google Document
body: <p>Just trying to make a simple script that makes a copy of a doc with a specified file ID and then opens that copy. </p>
  
  <p>The following script makes the copy but doesn't actually open the document:</p>
  
  <pre><code>function doGet(e) {
    var fileId = e.parameters.fileId;  
      if(!fileId){
      //fileId = Google Doc Id
      fileId = '1eeNxjDEkA0P3XEq6xdM0R2wAcc6sNP5_7hU3_f4ViAA';
      } 
    var newId = DocsList.getFileById(fileId).makeCopy('File copied to my drive').getId(); 
    DocumentApp.openById(newId);
  }
  </code></pre>
  
  <p>Can't figure out why. Any help would be really appreciated. Thanks.</p>