-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Learning Google Apps Script
By :
You might be wondering whether you can execute the greeting function without the help of the button. The answer is yes. In the script editor, there is a Run menu. If you click on Run | greeting, then the greeting function will be executed and the message box will open.
Creating a button for every function may not be feasible. Although you cannot alter or add items to the application's standard menu (except the Add-ons menu) such as File, Edit, View, and so on, you can add custom menus and menu items.
For this task, create a new Google Docs document or open an existing document. Open the script editor and type these two functions:
function createMenu() {
DocumentApp.getUi()
.createMenu("PACKT")
.addItem("Greeting","greeting")
.addToUi();
}
function greeting() {
var ui = DocumentApp.getUi();
ui.alert("Greeting", "Hello World!", ui.ButtonSet.OK);
}In the first function, you are using the DocumentApp...
Change the font size
Change margin width
Change background colour