title: Download Folder as Zip Google Drive API
body: <p>I currently have a Google App Script in Google Sheet that gives me the URL of a folder, which I can then use to download. Though it is an extra step I would like to remove, and get the URL of the zipped content directly.</p>
  
  <p>Here's my code (google app script):</p>
  
  <pre><code>function downloadSelectedScripts() {
    // ...
    var scriptFiles = getScriptFiles(scriptFileNames)
    var tempFolder = copyFilesToTempFolder(scriptFiles)
    Browser.msgBox(tempFolder.getUrl())
  }
  
  function copyFilesToTempFolder(files) {
    var tempFolder = DriveApp.getFolderById(FOLDERS.TEMP)
    var tempSubFolder = tempFolder.createFolder('download_' + Date.now())
  
    for (var i in files) {
      var file = files[i]
      file.makeCopy(file.getName(), tempSubFolder)
    }
  
    return tempSubFolder
  }
  </code></pre>