Replicate with Google Script the behaviour of "File" > "Download as..." in Google Spreadsheet -


i'm looking way either:

a) replace "file" > "download as..." > "microsoft excel (.xlsx)" in google spreadsheet in such way when click on "microsoft excel (.xlsx)" asks me name of file want save (i.e.: typical "save as..." menu entry).

b) if it's not possible replace standard menu entry, @ least add menu entry in menu behaves described above.

even though haven't been able write script lets me replace existing menu entry, i've managed write script adds additional menu.

is possible accomplish "a"?


another problem can't seem find way replicate behaviour of "file" > "download as..." > "microsoft excel (.xlsx)".

i've found other posts in it's described how write google scripts in order similar (e.g.: create backup of spreadsheet in google drive in specific format, or send via gmail specific address).

actually, after reading "can download file url link generated google apps script" i'm not sure it's possible.

note cannot download per se, since have no access pc's resources (e.g. file system) apps-script. file still in "the cloud"... in case, it's been copied web site on, google drive. if you're running drive app, though, file sync pc.

is there way that?


thanks in advance.

the way achieved download of file spreadsheet writing separate script accessed original spreadsheet document id, generated file , downloaded this:

function doget(){     var outputdocument = documentapp.create('some csv');      var content = getcsv();     var textcontent = contentservice.createtextoutput(content);     textcontent.setmimetype(contentservice.mimetype.csv);     textcontent.downloadasfile("4nocnimaraton.csv");     return textcontent; } 

then had publish app , link it. link placed in 1 of sheets in original spreadsheet, used data download link. other didn't find way work security issues around.


Comments