Apps Scriptリファレンス: Apps Script Reference |障害・課題追跡: IssueTracker |Google Workspace: Status Dashboard - Summary

2024年6月2日日曜日

Google Slidesにメニューを追加したい - Add a menu to Google Slides


Google Slidesの上部に SCRIPT > Dialog のメニューを追加するコードを試しました。 
I tried code to add a SCRIPT > Dialog menu to the top of Google Slides.


追加したSCRIPTメニュー からDialog をクリックすると、ダイアログが表示されます。
After clicking Dialog from the added SCRIPT menu, the dialog will be displayed.



Apps Script

Code.gs
function onOpen() {
SlidesApp.getUi()
.createMenu('SCRIPT')
.addItem('Dialog', 'modalessTemplate')
.addToUi();
}

function modalessTemplate() {
const htmlOutput = HtmlService
.createTemplateFromFile("index")
.evaluate()
.setWidth(360)
.setHeight(120);
SlidesApp.getUi().showModelessDialog(htmlOutput, "MyGUI");
}


index.html
<!DOCTYPE html>
<html>
<style>
textarea {
width: 80vw;
height: 50vh;
}
</style>
<body>
<textarea id="input"></textarea>
</body>
</html>


Reference

getUi()

Latest post

Google Classroom API でクラスの一覧を取得したい

自分が指導・参加しているクラスの名称とIDを取得するコードを試しました 下記 Code.gs では pageSize で 100 を設定していますが 必ず 100件 返ってくるとは限らないらしいです https://developers.google.com/workspace/...