0

I'm allways lost when I have to download a google sheet with script.

this is a script to generate a CSV.

function s2csv() {
var s, d, sname, vals, f;
d=";";//<<<set the desired delimiter
s=SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
sname=s.getName();
vals=s.getDataRange().getValues().map(function(x) {return x.join(d);}).join('\n');
f=DriveApp.createFile(sname+".csv", vals, MimeType.CSV);  
}

I can "download" it on my Drive, but how should I finish my script to download this csv file onto my computer instead of my "google Drive"?

  • 1
    If the linked duplicate answers doesn't answer your question, [edit] your question to explain how the answers don't satisfy you. If you're having trouble implementing a solution, ask a new specific question with the part you're having trouble with. – TheMaster Oct 18 '21 at 21:28

0 Answers0