title: Why is this sample AppScript returning error: "Access Denied: DriveApp?"
body: <p>I received this error when attempting to run the sample Drive AppScript, even after authorizing the AppScript to access Drive. I have also tried hard-coding a folder ID and am receiving the same error. </p>
  
  <p>The code is as follows:</p>
  
  <pre><code>function listFilesInFolder(id) {
    var folder = DriveApp.getFolderById(id);
    var contents = folder.getFiles();
    var file;
    var name;
  
    while(contents.hasNext()) {
      file = contents.next();
      name = file.getName();
      Logger.log(name);
    }
  };
  </code></pre>