Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function doGet(e){
- // code make changes to spreadsheet
- // here I want browser window to close
- return HtmlService.createHtmlOutput(uniqueid + " is marked complete");
- };
- <script>
- window.top.close();
- </script>
- <script>
- setTimeout(function(){ window.top.close(); }, 3000);
- </script>
- <script>
- window.onload=function(){
- console.log("This onload did run");
- setTimeout(function(){ window.top.close(); }, 3000);
- };
- </script>
- <!DOCTYPE html>
- <html>
- <script>
- window.top.close();
- </script>
- </html>
- function doGet(e){
- // code make changes to spreadsheet
- var ss = SpreadsheetApp.openById([The key for the spreadsheet you wish you modify])
- var sheet = ss.getActiveSheet()
- var lastRow = sheet.getLastRow()
- var params = JSON.stringify(e);
- var paramsArray = JSON.parse(params)
- sheet.getRange(lastRow + 1, 1).setValue('Code made changes to spreadsheet at ' + Date())
- sheet.getRange(lastRow + 1, 2).setValue(paramsArray.parameter.change)
- // here I want browser window to close
- var uniqueid = "Someuniqueid"
- return HtmlService.createHtmlOutputFromFile('Close Window'), HtmlService.createHtmlOutput(uniqueid + " is marked complete")
- };
- function mailIt() {
- var emailAddress = Browser.inputBox('What email address do you want to send the WebApp to?')
- var html = HtmlService.createTemplateFromFile('HTML Email to run Web App')
- var htmlCode = html.getRawContent()
- Logger.log(htmlCode)
- MailApp.sendEmail({
- name: "Publish WebApp for survey embed Test",
- to: emailAddress,
- subject: "Publish WebApp for survey embed Test",
- htmlBody: htmlCode
- })
- }
- <!DOCTYPE html>
- <html>
- <form action=[Your current Web App URL in quotes]>
- Send text to spreadsheet: <input type="text" name="change"><br>
- <input type="submit" value="Submit">
- </form>
- </html>
- google.script.host.close();
Add Comment
Please, Sign In to add comment