Google Apps Script – custom menu – part 004.

This tutorial is about how to add a custom into your google document using the google app script.
First, you need to have one open document and then click into the menu : Tools – Script editor …
You will see a new document into your browser with a link like this: …
This will allow you to create New – Project, Script file, Html file, and Google documents.
Use the like the base of the script and add this source of code:

Now add this new Html page named Page.html with this source code:

The result is this:

The base of the drawing menu is the onOpen function to create and draw the menu by getting the document and create and add menu and submenu with separators. This comes with the text of the menu and the functions for each click on the menu.

In this example, I used one HTML page file. That HTML page shows us by using the showDialog function.
The documentation of Google Apps Script tells us:
The UI service in Google Apps Script provides the ability to build a user interface for displaying or capturing information using user interface elements called widgets.

Your scripts can create a wide range of user interface elements, including, but not limited to, the following:

Push buttons
Radio buttons
Toggle buttons
Text fields
List boxes
Dialog boxes
Panels of many types
And far more elements than it’s possible to list here.
You can also test one edit box example by adding this function and change the onOpen function to show it.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.