
Going GAS
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
Whether you're moving from Microsoft Office to Google Docs or simply want to learn how to automate Docs with Google Apps Script, this practical guide shows you by example how to work with each of the major Apps Script services.
Office still supports VBA, but it's not likely to do so for much longer. If you're a VBA or .NET developer, you'll learn how to port existing VBA code and structure to their JavaScript-based Apps Script equivalents with minimal effort. Author Bruce Mcpherson introduces JavaScript basics for experienced developers unfamiliar with the language, and demonstrates ways to build real-world apps using all of the Apps Script services previously covered.
- Use App Script's equivalent of Excel's object model
- Target the most commonly used parts of Microsoft Word
- Automate processes in Gmail, Calendar, and Contacts
- Access the local client filesystem with Google Drive
- Build and run applications in a browser
- Store persistent data conveniently
- Render HTML content in response to HTTP requests
- Automate the maintenance and creation of pages and content
- Interact with a REST service or NoSQL database
- Access Apps Script capabilities from other platforms
More details
Other editions
Additional editions

Content
- Intro
- Copyright
- Table of Contents
- Preface
- Why Read This Book?
- Why Transition from VBA?
- Intended Audience
- The VBA Library
- Reading Order
- The Examples
- Conventions Used in This Book
- Using Code Examples
- Safari® Books Online
- How to Contact Us
- Acknowledgments
- Chapter 1. Introduction
- What Is VBA?
- Extending
- Fragility
- Security
- Asynchronicity
- Efficiency and Performance
- Maintainability
- What Is JavaScript?
- A Quick History
- Versions
- JavaScript Is Not Java
- Learning JavaScript
- What Is Apps Script?
- Versions
- It Runs on a Server
- Services
- Fully Authenticated Environment
- Quotas
- Performance
- Asynchronicity
- Events
- Triggers
- Web Apps
- Maintainability
- IDE
- What Is Apps Script Good For?
- What Are Google Add-Ons?
- Types of Add-Ons
- Security
- The Publishing Process
- What Are Google Forms?
- What Are Microsoft Add-Ins?
- Comparison
- Chapter 2. Language Basics
- Style
- Hungarian
- Camel Case
- Case Sensitivity
- Copy/Paste Porting
- Types
- Operators
- Mathematical Operators
- Assignment Operators
- String Operators
- Comparison Operators
- Logical Operators
- Bitwise Operators
- Variables
- Variable Types
- Functions
- Assigning Functions to Variables
- Anonymous Functions
- Functional Programming
- Loops and Iteration
- Layout
- Whitespace and Newlines
- Semicolons
- Curly Braces
- Scope
- Objects
- JavaScript Object Notation
- JSON Examples
- Classes
- Prototypes and Constructors
- Inheritance
- Methods
- A Note on this
- Getters and Setters
- VBA Example
- Using Object.create
- Conclusion
- Namespaces
- Google Services
- Libraries
- Creating Your Own Namespace
- Avoiding Namespace Collisions
- The IDE
- Container-Bound Scripts
- Standalone Scripts
- Code Examples
- Accessing the IDE
- Running a Function
- Examining Results
- Libraries
- Libraries in the Cloud
- Namespaces and Libraries
- Managing Library Versions
- Adding Libraries to a Project
- Some Notes on Library Sprawl
- Chapter 3. Translating VBA Functions
- Conventions
- Library and Namespace
- JSDOC
- JSDOC Example
- VBA Built-Ins Translated to JavaScript
- Helper Functions
- String Functions
- Conversion Functions
- Math Functions
- Informational Functions and Constants
- Date and Time Functions
- Optional Arguments
- Testing for undefined
- Applying Default Values
- Named Arguments
- Handling Errors
- VBA Exception Branching
- JavaScript try/catch
- Raising an Error
- VBA Built-In Objects
- Type
- Key/Value Pairs
- Collections
- Chapter 4. Living with the Quotas
- The Quotas
- Daily Limits
- Limitations
- Triggers
- Rate Limits
- Throttling
- Sleeping
- Exponential Backoff
- Splitting
- Libraries
- Batching
- Parallel Running
- Offloading
- Avoiding Service Calls
- Cache Service
- Chapter 5. The Properties Service
- APIs Versus Built-In Services
- Getting Started with Properties Service
- Uses and Types of Property Stores
- Selecting a Property Store
- The Registry Versus the Property Store
- Comparisons
- Chapter 6. The Spreadsheet Service
- Custom Formulas
- Container-Bound Versus Standalone Scripts
- Getting Started with the Spreadsheet Service
- A Note About Authorization
- Opening the Active Sheet
- The Range Class
- Creating a Range
- Returning the Data Range
- Getting the Values of a Range
- Writing Values to a Range
- Returning Selected Data
- Reading and Writing for Partial Ranges
- Reading Attributes from a Range
- Writing Attributes to a Range
- Inserting and Deleting Rows and Columns
- Opening Other Sheets
- Iterating All Sheets
- Getting a Sheet by Name or Index
- Opening Other Workbooks
- Creating a Standalone Script
- Accessing Multiple Workbooks
- Working with Multiple Workbooks
- Updating Sheets
- Showing Messages
- Toast
- Showing Messages with Buttons
- Getting Input
- Getting and Setting Properties
- Document, User, or Script?
- Setting Properties in the Registry
- Setting Properties Using the Properties Service
- Changing Settings
- Custom Formulas
- Copy/Paste Port
- Native Port
- Arguments to Custom Formulas
- Performance
- Documentation and Autocomplete
- Adding Functions to Menus
- Tables
- Converting Values to an Object
- Emulating Tables in Apps Script
- ListObject
- Chapter 7. The Document App
- Opening Documents
- Working with Elements
- Traversing the Document
- Traversing in VBA
- Annotating the Document
- Ranges
- VBA Range
- VBA Discontiguous Ranges
- RangeElements
- The showRange Utility
- RangeBuilder
- Named Ranges
- Setting a Cursor Using a Named Range
- Position
- Position Within Element
- Creating a Selection
- Creating a VBA Selection
- Inserting Text
- Bookmarks
- IDs
- VBA Bookmark Insert
- Bookmark Appearance
- Traversing Bookmarks
- Text Bookmarks
- Creating Links
- Setting a Cursor Position
- Removing Bookmarks
- Editing Text in Elements
- Adding Elements
- Containers
- Element childIndex
- VBA childIndex
- Inserting Elements
- Tables
- List Items
- VBA ListParagraph
- Images
- Docs Automation Example
- Selecting the Target Area
- Inserting the Table
- Adding to Custom Menu
- Attributes
- Text Attributes
- Attribute Equivalence
- Partial Attributes
- Attribute Indices
- Chapter 8. Gmail, Calendar, and Contacts Apps
- Email Automation Exercise
- Scenario
- Threads
- Searching
- Messages
- Message Filtering
- Regular Expression Searching
- Name Lookup
- Body Errors
- Result Reduction
- Generate a Regular Expression
- Attachments
- Organizing
- Recipients
- Organizing by Recipient
- Sending
- Labels
- VBA Categories
- Calendar
- Events
- The Courses Namespace
- Advanced Calendar Service
- Contacts
- ContactGroups
- Contacts Namespace
- Organizing Courses
- Setting Up the Example
- The Settings
- Triggers
- Apps Script Main Function
- VBA Main Function
- Scheduling
- Chapter 9. Drive and DriveApp
- Microsoft OneDrive
- Reading and Writing Files
- VBA FileSystemObject
- Apps Script DriveApp Service
- Chapter 10. HTML Service
- Why Client Execution?
- The Downside
- The VBA Connection
- HTML Service Varieties
- Web Apps
- Dialogs
- Sidebars
- jQuery
- Event Handling
- Templates
- Structure
- Controlling Apps Script from the Client
- Using Namespaces in HtmlService
- Multiple Menu Items
- indexRun.html
- mainRun.js
- Client Namespace
- Render.js
- App.js
- Dialog HtmlService
- HtmlService Web Apps
- VBA User Form
- Create a User Form
- Initialize the Combo Box
- Listen for Changes
- The Form
- Chapter 11. Content Service
- The Content Service
- Where to Use the Content Service
- Types of Content
- Example
- Request
- Response
- Details
- doGet
- The Settings
- SheetOb
- getFlight
- getRegex
- Initial Result
- JSONP
- XML
- makeXml
- Publishing
- Script Files
- The Publishing Process
- Permissions
- Delegation from VBA
- Querying Apps Script
- Chapter 12. Charts
- Chart Data
- VBA Charts
- Code
- Sheets Charts
- EmbeddedChartBuilder
- setPosition
- Types of Chart
- Visualization API
- Google Visualization HtmlService App
- Other Chart Formats
- Chapter 13. Sites
- Apps Script
- Gadgets
- Code Lockdown
- Advertising
- VBA
- The Future of Sites
- Chapter 14. Advanced Google Services
- What Are Advanced Google Services?
- Advanced Services Versus Google APIs
- Developers Console
- Enabling Advanced Services
- Fusion Tables Example
- Settings Namespace
- Copy Sheet to Fusion
- Fusion Namespace
- Fusion Quotas
- Scripts Structure
- Currently Available Advanced Services
- Chapter 15. Authentication and Security
- OAuth 2.0
- Setup
- Access
- Refresh
- Scopes
- Limiting Scope to the Current Document
- Listing Authorized Apps
- Revoking Access
- ScriptApp
- Service Accounts
- Libraries
- OAuth 2.0 Example
- Creating the Cloud Console Project
- Scopes
- Accessing Other Oauth 2.0 Services
- OneDrive Authentication
- Other OAuth 2.0 Services
- OAuth 2.0 with VBA
- Developers Console
- getGoogled
- Content Service with OAuth2
- Other Kinds of Authentication
- Basic Authentication
- JWT (JSON Web Tokens)
- What Is a JWT?
- Firebase Authentication
- JWT Format
- FirebaseAuth Namespace
- Standardized OAuth 2.0 Process
- Chapter 16. External APIs and Integration
- REST API
- Code
- Reuse
- Databases
- Firebase
- Main Code
- Permissions
- Settings
- Firebase Class
- Reuse
- Result
- Databases and Apps Script
- Chapter 17. Execution API
- What Is Incremental Migration?
- Migration Process
- The Execution API
- Inventory for Execution API
- Authentication and Access
- Credentials
- Publishing
- Scopes
- Getting Googled
- JSON
- SheetExec
- Example Workflow Migration from Office
- Moving a Workbook to Sheets
- VBA Code to Read a Sheet
- Apps Script Code to Read a Sheet
- VBA Code to Write Data to a Local Workbook
- VBA Code to Write to a Sheet from a Local Workbook
- Apps Script Code to Write to a Sheet from a Local Workbook
- Migrating Logic
- VBA Code to Initiate Logic on Apps Script
- Logic Code Delegated to Apps Script
- VBA Orchestration
- VBA Process Orchestration Code
- Apps Script Logging Code
- Final Migration Steps
- Testing JavaScript on the PC
- VBA Code to Get Source Code from Apps Script
- Apps Script Code to Return Source Code
- Getting the Source and Testing Local Execution
- Execution API Potential
- Chapter 18. Office Add-Ins and Google Add-Ons
- Add-Ons
- Add-Ins
- The Same...
- ...But Different
- Add-On Example
- The Dataset
- Capabilities
- Apps Script Add-On
- What You Will Learn
- The Namespaces
- Sharing Code Between Client and Server
- index.html
- main.js
- styles.css
- App Namespace
- Cors
- Add-On Script
- Reused Namespaces
- Server Namespace
- Client Namespace
- Render Namespace
- Testing an Add-On
- Office Add-In
- What You Will Learn
- The IDE
- Structure
- index.html
- mainOffice.js
- App.js
- Client.js
- Testing the Add-In
- Result Comparison
- Further Exercises
- Afterword
- Appendix A. Further Resources
- GitHub Repository
- Repository Structure
- gscript Files
- Other Resources
- Keys and Credentials
- Index
- About the Author
System requirements
File format: PDF
Copy-Protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (only limited: Kindle).
The file format PDF always displays a book page identically on any hardware. This makes PDF suitable for complex layouts such as those used in textbooks and reference books (images, tables, columns, footnotes). Unfortunately, on the small screens of e-readers or smartphones, PDFs are rather annoying, requiring too much scrolling.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our eBook Help page.