here you go: (you need to publish that if you want it to work) it will export the selection that you are making
function onOpen() {
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var entries = [{
name : "make CSV",
functionName : "myFunction"
}];
spreadsheet.addMenu("Script Center Menu", entries);
};
function myFunction() {
var a1 = SpreadsheetApp.getActiveRange().getA1Notation();
var url = ScriptApp.getService().getUrl()+"?ref="+a1+"&sheet="+SpreadsheetApp.getActiveSheet().getName()+"&ssid="+SpreadsheetApp.getActive().getId();
var vals = SpreadsheetApp.getActiveRange().getValues();
var html = "here the download Link <a href='"+url+"' >"+url+"</a>";
//SpreadsheetApp.getActive().show(HtmlService.createHtmlOutput(html)); // ol sheet style
SpreadsheetApp.getUi().showModalDialog(HtmlService.createHtmlOutput(html), 'download box'); // new sheet style
}
function doGet(e){
var ref = e.parameter.ref;
var sheet = e.parameter.sheet;
var ssid = e.parameter.ssid;
var out = ContentService.createTextOutput(SpreadsheetApp.openById(ssid).getSheetByName(sheet).getRange(ref).getValues().join("\n")).downloadAsFile("out.csv");
return out;
}