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 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 base of 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 drawing menu is the onOpen function to create and draw the menu by get the document and create and add menu and submenu with separators. This come with the text of muenu and the functions for each click on menu.

In this example, I used one html page file. That html page is show us by using the showDialog function.
The documentation of Google Apps Script told 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
Check boxes
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.