Back again with the createdocsListDialog function 🙂
I’ve got it working however, I’d like to limit the files to be selected to be only spreadsheets.
“Error encountered: Cannot find method setInitialView(string). (line 13)”
The .setInitialView appears in the script editor as a method, but when running.. not so much. Here’s the code.
var doclisthandler = app.createServerHandler('selectionhandler');
var doclist = app.createDocsListDialog().showDocsPicker() .addSelectionHandler(doclisthandler).setInitialView('spreadsheet');
Any ideas?
From the code completion itself you can see that the
setInitialViewfunction does not expect a string as parameter, but a FileType constant. On the docs you can see it is calledSPREADSHEETS.Here is how it works: