Concept
What is Apps Script?
Google Apps Script is JavaScript that runs on Google's servers and can control Google Workspace apps: Sheets, Gmail, Drive, Docs, Calendar, Forms and more. You don't install anything — you write code in the browser, and Google runs it for you.
If you know Excel VBA, think of Apps Script as "VBA for Google Sheets", with one big difference: it can also send emails, create Drive folders, make PDFs and call websites — all from the same script.
What can you automate?
| Task | Without code | With Apps Script |
|---|---|---|
| Send 200 personalised emails from a sheet | Copy-paste 200 times | One click |
| Make a PDF invoice for every new order | Fill a template by hand | Automatic on each new row |
| Get an alert when stock is low | Check the sheet daily | Email arrives on its own |
| Pull exchange rates or gold rates from an API | Type them in | Updates every hour |
When should you use it?
Use Apps Script when:
- Your data already lives in Google Sheets / Forms / Drive.
- The task is repetitive and follows clear rules.
- You want it to run on a schedule or when something happens (a form is submitted, a cell is edited).
Pick something else when:
- You need heavy data processing (millions of rows) → Python is better.
- Your team works only in desktop Excel → use VBA or Power Automate.
- You need a script to run for hours → Apps Script stops a single run after about 6 minutes.
Your first script (2 minutes)
- Open any Google Sheet.
- Click Extensions → Apps Script.
- Replace the code with:
function sayHello() {
SpreadsheetApp.getActiveSpreadsheet().toast('Namaste from Apps Script!');
}
- Click Save, then Run. Approve the permission prompt the first time.
- Go back to the sheet — a small popup appears in the bottom-right corner.
You just ran code on Google's servers that talked to your sheet.
Key points
- Apps Script = JavaScript + ready-made objects such as
SpreadsheetApp,GmailApp,DriveApp. - It is free with a Google account; limits (quotas) depend on whether you use a personal or Workspace account.
- Scripts run in the cloud, so they keep working even when your computer is off.