You are previewing Learning Google Apps Script.
O'Reilly logo
Learning Google Apps Script

Book Description

Customize and automate Google Applications using Apps Script

About This Book

  • Gain insight into customizing and automating Google applications with JavaScript

  • Create add-ons for Google Sheets, Docs, or Forms; automate your workflow; integrate with external APIs; and more.

  • A step-by-step guide to building real-world solutions

  • Who This Book Is For

    Newbies to google apps script but having practical experience in Javascript.

    What You Will Learn

  • Learn about the Google Apps script platform and work with scripts to develop Google apps

  • Create custom menus and dialogs

  • Parse and send emails

  • Generate Google calendar events

  • Build Translator and RSS reader applications

  • Develop interactive web pages

  • Design interactive web-forms

  • Form a workflow application

  • In Detail

    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

    Style and approach

    An easy-to-follow yet comprehensive guide, filled with many code examples and screenshots illustrating various Google Apps scripts.

    Downloading the example code for this book. You can download the example code files for all Packt books you have purchased 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 code file.

    Table of Contents

    1. Learning Google Apps Script
      1. Table of Contents
      2. Learning Google Apps Script
      3. Credits
      4. About the Author
      5. About the Reviewer
      6. www.PacktPub.com
        1. eBooks, discount offers, and more
          1. Why subscribe?
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. Introducing Google Apps Scripts
        1. Google Applications
        2. Google Apps Script
          1. Visual Basic for Applications
          2. The advantages of GAS over VBA
          3. The limitations of GAS
        3. Google Drive
        4. Gmail
        5. Google Calendar
        6. Google Docs
        7. Google Sheets
        8. Google Apps services
          1. Creating Google Sheets in Drive and sharing them with your friends and the public
        9. Script projects
          1. Creating standalone script projects
          2. Creating new projects in Sheets
          3. Creating a custom formula in Sheets
        10. Google Forms
          1. Creating Forms within Google Sheet
          2. Some research
        11. Summary
      9. 2. Creating Basic Elements
        1. Creating a clickable button
        2. Showing toast when a button is clicked
        3. Creating a custom menu
        4. Creating a sidebar
        5. Creating an Add-ons menu
        6. Creating a modal dialog
        7. Creating a modeless dialog
        8. Debugging your script
        9. Summary
      10. 3. Parsing and Sending E-mails
        1. Creating Gmail Contacts by script
        2. Accessing Sheet, cell, range, and offset
        3. Reading and writing the Sheet data
        4. Building a Gmail Contact search application
        5. Building the Gmail parser application
        6. Properties service
        7. Downloading Gmail attachments to Drive
        8. Sending e-mails using the MailApp service
        9. Sending an e-mail notification on Form submission
        10. Creating triggers manually
        11. Creating and deleting triggers by script
        12. Forwarding e-mails if the specific keyword is found in the message body
        13. Sending e-mail with attachments
        14. Embedding inline images in an e-mail message
        15. Building an e-mail merger application
        16. Summary
      11. 4. Creating Interactive Forms
        1. Creating Forms using script
        2. Publishing the script as a web application
        3. HtmlService
        4. Creating a Form using HtmlService
        5. Submitting form using Google script API method
        6. Creating forms using add-ons CSS and jQuery libraries
        7. Creating an e-voting application
        8. Creating a ticket reservation application
        9. Summary
      12. 5. Creating Google Calendar and Drive Applications
        1. The CalendarApp class
          1. Creating Calendar events from a simple description
          2. Creating simple Calendar events
          3. Creating events with options
          4. Creating events from Sheets data
          5. Creating events from an external CSV file's contents
        2. Enabling advanced Google services
          1. Listing all the Calendars
          2. Listing Calendar events in Sheets
          3. Syncing events from one Calendar to another Calendar
        3. The DriveApp class
          1. Creating customized PDF files
          2. Creating a Drive file routing application
          3. Creating a Drive file search application
        4. Summary
      13. 6. Creating Feed Reader and Translator Applications
        1. The UrlFetchApp class
          1. Creating a Google search application
          2. Creating a stock quote ticker application
          3. Logging Bitcoin quotes
        2. RSS and Atom feeds
          1. Skeleton of a RSS feed document
          2. Creating an RSS reader application
          3. Skeleton of an Atom feed document
          4. Creating an Atom feed reader application
          5. Using optional parameters with the UrlFetchApp class
        3. The LanguageApp class
          1. Creating the language translator application
        4. Creating a document reviewing and instant inline commenting application
        5. Summary
      14. 7. Creating Interactive Webpages
        1. Creating a web app to render Sheet data as HTML
        2. Creating a web app to return JSON
        3. Converting Sheet data as a PDF file
        4. Sending an HTTP/HTTPS request with query string
        5. Creating RSS feed using ContentService
        6. Creating a file upload application
        7. Creating an employee timesheet application
        8. Summary
      15. 8. Building a Workflow Application
        1. Order processing workflow – steps explained
        2. Configuring Google Sheets
        3. Creating the Order form
        4. Enhancing the Order form
        5. Creating the dispatch form
        6. Dispatching the articles
        7. Enabling the user to acknowledge the article delivery
        8. Summary
      16. 9. More Tips and Tricks and Creating an Add-on
        1. Overcoming the "script exceeded maximum execution time" error
        2. Configuring your script project to use external libraries
        3. Using JSDoc annotations
        4. Using the OAuth open source library
        5. Creating, testing, and publishing add-ons
          1. Installing add-ons from Chrome Web Store
          2. Creating custom add-ons
          3. Testing your add-on
          4. Creating an add-on that uses an OAuth2 external library
        6. Other useful links
        7. Summary
      17. Index