1

Set Clicable Image

How to make trigger Clickable Image with App Script ? I Use this script but didn't work.

    function downloadPdf() {UrlFetchApp.fetch('https://docs.google.com/spreadsheets/d/e/2PACX-1vQ14uGARmUSk6dx40XwkrbP7oD90M8h-Sn1EZNr0sNBKkA0PmQsY5WC6MXLA4ltVrrDB4lEjbP63ABt/pub?gid=1602250439&single=true&output=pdf')};

How I must write the script? So the link can direct open, and the file can be download directly with that link.

1 Answers1

2

Open up a url in another tab

function openUrl(){
  let html = '<h1>Dummy Dialog</h1><script>window.onload = function(){google.script.run.withSuccessHandler(function(url){window.open(url,"_blank");google.script.host.close();}).getMyUrl();}</script>';
  SpreadsheetApp.getUi().showModelessDialog(HtmlService.createHtmlOutput(html),"Dummy Dialog");
}

function getMyUrl() {
  console.log('getting url');
  return "http://www.google.com";
}
Cooper
  • 59,616
  • 6
  • 23
  • 54