What Is Google Apps Script?

Google Apps Script (GAS) is a cloud-based JavaScript platform that lets you automate and extend Google Workspace applications — Sheets, Docs, Gmail, Drive, Calendar, and more. You write code directly in your browser, and Google runs it on their servers. No setup, no local environment, no deployments required.

If you've ever wanted to automate repetitive tasks, build custom menu items in a spreadsheet, or send emails programmatically, Apps Script is your tool.

How to Open the Script Editor

There are two ways to start writing Apps Script:

  1. From a Google Sheet/Doc: Open the file, click Extensions → Apps Script.
  2. From script.google.com: Go to script.google.com to create a standalone script not tied to any file.

Once you're in the editor, you'll see a default myFunction() stub. This is where your journey begins.

Your First Script: Hello World

Let's write a simple script that logs a message to the console:

function helloWorld() {
  Logger.log("Hello, Google Apps Script!");
}

Click the Run button (or press Ctrl+Enter), grant permissions when prompted, and then open View → Logs to see your output. That's it — your first Apps Script is live.

Understanding the Two Types of Scripts

TypeWhere It LivesBest For
Container-boundAttached to a Sheet, Doc, or FormAutomating a specific file
Standalonescript.google.comGeneral utilities, web apps, services

Key Services You'll Use Often

  • SpreadsheetApp — Read/write Google Sheets data
  • GmailApp — Send and manage emails
  • DriveApp — Work with files and folders
  • DocumentApp — Automate Google Docs
  • CalendarApp — Create and manage calendar events
  • UrlFetchApp — Make HTTP requests to external APIs

Triggers: Running Scripts Automatically

One of Apps Script's most powerful features is triggers — they allow your code to run automatically based on events:

  • Time-driven triggers: Run a function every hour, day, or week.
  • onOpen: Runs when a file is opened.
  • onEdit: Fires whenever a cell in a Sheet is edited.
  • onFormSubmit: Triggers when a Google Form receives a response.

To add a trigger, click the clock icon in the editor sidebar or use the ScriptApp.newTrigger() API programmatically.

Quotas and Limitations to Know

Apps Script runs on Google's servers for free, but there are daily quotas to be aware of:

  • Scripts have a maximum execution time of 6 minutes per run (30 minutes for Workspace Business/Enterprise).
  • Email sending is limited to a certain number per day based on your account type.
  • UrlFetch calls and other services also have daily limits.

For most personal and small-team projects, these limits are more than sufficient.

Next Steps

Now that you understand the basics, try building something practical: a script that reads data from a spreadsheet row and sends a summary email. From there, explore triggers, the Properties Service for storing configuration, and the HTML Service for building web app UIs. The possibilities are enormous — and you're just getting started.