title: Download "automatically" spreadsheet as .xlsx to local machine on event
body: <p>See below the function that converts the active Google Spreadsheet to a .xlsx file. The script saves the file in Google Drive.</p>
  
  <pre><code>function downloadAsXlsx() {
  
  var spreadSheet = SpreadsheetApp.getActiveSpreadsheet(); 
  var ssID = spreadSheet.getId();
  
  Logger.log(ssID);
  
  var url = "https://docs.google.com/spreadsheets/d/"+ssID+"/export?format=xlsx";   
  var params = {method:"GET", headers:{"authorization":"Bearer "+ ScriptApp.getOAuthToken()}};
  var response = UrlFetchApp.fetch(url, params);
  
  // save to drive
  DriveApp.createFile(response);
  
  }
  </code></pre>
  
  <p>If you replace the ssID in the URL above by the actual file id of the active Google Spreadsheet and copy and paste the URL in the browser, the active spreadsheet is downloaded "automatically". That is exactly what I need to be added to above script.</p>
  
  <p>My question is how to change and/or extend the function above so that the file is instead downloaded to the local machine in the default download folder?</p>