Book Image

Learning Google Apps Script

By : Ramalingam Ganapathy
Book Image

Learning Google Apps Script

By: Ramalingam Ganapathy

Overview of this book

Google Apps Script is a cloud-based scripting language based on JavaScript to customize and automate Google applications. Apps Script makes it easy to create and publish add-ons in an online store for Google Sheets, Docs, and Forms. It serves as one single platform to build, code, and ultimately share your App on the Web store. This book begins by covering the basics of the Google application platform and goes on to empower you to automate most of the Google applications. You will learn the concepts of creating a menu, sending mails, building interactive web pages, and implementing all these techniques to develop an interactive Web page as a form to submit sheets You will be guided through all these tasks with plenty of screenshots and code snippets that will ensure your success in customizing and automating various Google applications This guide is an invaluable tutorial for beginners who intend to develop the skills to automate and customize Google applications
Table of Contents (16 chapters)
Learning Google Apps Script
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Preface

Google Apps is a collection of applications, namely, Gmail, Calendar, Drive, Docs, Sheets, and Forms. You can customize or automate Google Apps using the scripting language JavaScript with Google's defined classes. Google implements Google Apps Script (GAS) based on JavaScript.

Almost all Google Apps provide one or more services. GAS services and APIs provide easy access to automate tasks across Google products and third-party services. You can use these service classes in your GAS code to customize or automate Google Apps.

This book introduces basic things first before moving to advanced concepts step by step with practical code and examples. By reading this book, you'll gather expertise in Google Apps Script. Happy reading!

What this book covers

Chapter 1, Introducing Google Apps Scripts, tells you about Google Apps and gives you an introduction to Apps Scripts, explains how to create a project, and introduces custom formulas.

Chapter 2, Creating Basic Elements, covers many types of dialog and how to create and display them, how to use the Logger class to log values, and how to debug your script.

Chapter 3, Parsing and Sending E-mails, talks about the ContactApp, MailApp, and GmailApp services. Using these services, you'll create many useful real-world applications, including an e-mail merger application.

Chapter 4, Creating Interactive Forms, deals with creating Forms dynamically by script, publishing the script as a web application, creating Forms using HtmlService, creating an e-voting application, and creating a ticket reservation application.

Chapter 5, Creating Google Calendar and Drive Applications, teaches the reader to create Calendar events and sync events from one Calendar to another Calendar. This chapter also teaches how to enable GAS advanced services.

Chapter 6, Creating Feed Reader and Translator Applications, is about learning and creating many useful applications, including RSS/Atom reader and language translator applications.

Chapter 7, Creating Interactive Webpages, tells how to create an RSS feed/publisher, a file uploading application, and a full-blown timesheet application using HtmlService.

Chapter 8, Building a Workflow Application, explains how to create a workflow application and proceeds create a useful real-world order processing application.

Chapter 9, More Tips and Tricks and Creating an Add-on, is all about using external libraries including OAuth2, and Apps Script add-ons.

What you need for this book

You will need any modern browser and basic working or theoretical knowledge of HTML, CSS, and JavaScript.

Who this book is for

This book is for newbies to Google Apps Script who have less practical experience of web development and curious to gather expertise in customizing Google Apps and developing web apps.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "A default myFunction function will be there in the editor."

A block of code is set as follows:

function greeting() {
  Browser
}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

  </head>
  <body>
    <button onclick="alert('Hello World!');">Click Me</button>
  </body>
</html>

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Go to Add-ons | Chapter 2 | Show Dialog and a modal dialog will pop up."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

You can download the code files by following these steps:

  1. Log in or register to our website using your e-mail address and password.

  2. Hover the mouse pointer on the SUPPORT tab at the top.

  3. Click on Code Downloads & Errata.

  4. Enter the name of the book in the Search box.

  5. Select the book for which you're looking to download the code files.

  6. Choose from the drop-down menu where you purchased this book from.

  7. Click on Code Download.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows

  • Zipeg / iZip / UnRarX for Mac

  • 7-Zip / PeaZip for Linux

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.