LANG SELRCT

Apps Script Reference  (Create: Create new Spreadsheet | Create new Apps Script

Wednesday, October 21, 2020

showModelessDialogでスプレッドシート上にUIを表示する


MISSION
showModelessDialogでスプレッドシート上にUIを表示する



以下のコード.gsのmyFunction()をスクリプトエディタで実行すると
このようなUIを表示できます。

モーダルとは異なり、UIを表示したときにも背後のシートを操作できます。



コード.gs
function myFunction() {
  const htmlOutput = HtmlService
      .createHtmlOutput('<p>ここに表示したい内容をhtmlで書ける。</p><br><a href="https://www.google.com/">リンクもはれる</a>')
      .setWidth(360)
      .setHeight(120);
  SpreadsheetApp.getUi().showModelessDialog(htmlOutput, "MyGUI");
}

Latest post

Creating a template copier app in Google Apps Script

Introduction This article will show you a template copier application in Google Apps Script.  This application will automatically copy a t...