The popular open-source contract for web professionals by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: March 15th 2016
- Original post
function onOpen() { | |
SpreadsheetApp.getUi() | |
.createAddonMenu() | |
.addItem('Upload', 'upload') | |
.addToUi(); | |
} | |
function upload() { | |
const hs = HtmlService.createHtmlOutput( | |
'<form><input type="file" name="file" onchange="var reader = new FileReader(); reader.onloadend = (e) => google.script.run.withSuccessHandler(google.script.host.close).importICS(e.target.result); reader.readAsText(this.parentNode.file.files[0]);"></form>' |