Thinking that programming is too difficult or only for tech pros? Think again!
With Google Apps Script (GAS), you don’t need expensive software or complex setup procedures. You can start automating right now, directly inside your web browser.
In this tutorial, we’ll cover the fundamentals of GAS and show you how to display your very first message using the essential command: Logger.log().
What is Google Apps Script (GAS)?
Simply put, GAS is like an automated assistant that works inside Google Workspace apps like Google Sheets and Gmail.
Instead of spending hours on tedious manual work, GAS lets you:
- Clean up and process spreadsheet data with a single click.
- Automatically send email summaries or daily schedules at specified times.
- Collect Google Forms responses and organize them into neat tables instantly.
It handles repetitive tasks instantly, saving you valuable time!
STEP 1: Open the GAS Script Editor
First, let’s open the code editor where we’ll give instructions to our script. You can access it in just 3 seconds with a few clicks.
Instructions:
- Open a new Google Sheet.
- Click Extensions in the top menu bar.
- Select Apps Script.
A new tab will open with the script editor. Once you see a clean screen with a few default lines of code, you’re ready to go!
STEP 2: The Core Command: Logger.log()
The main command to learn today is:
Logger.log()
What does Logger.log() do?
This command tells GAS: “Print whatever is inside these parentheses onto the screen as a log note!”
Think of it like tasting your food while cooking. Developers use Logger.log() to check if their code is working correctly and to inspect values while the script runs.
Formatting Rules
Text strings must always be enclosed in double quotes (" ").
- Correct:
Logger.log("Hello!") - Incorrect:
Logger.log(Hello!)(missing double quotes)
STEP 3: Run Your First Code!
Let’s write and execute your first script.
1. Paste the Code
Clear out any default text in the editor. Copy and paste the following code:
function myFunction() {
Logger.log("Today's weather in Sapporo is sunny!");
}
2. Execute
Press the control buttons at the top of the editor:
- Click the Save icon (floppy disk).
- Click Run.
3. View the Result
Look at the Execution log pane at the bottom of the screen.
If you see:
Today's weather in Sapporo is sunny!
Congratulations! Your code executed perfectly according to your command.
Troubleshooting Checklist
If you see red error messages or nothing appears, check these common issues:
- Are text strings enclosed in double quotes?
Double-check that your message is wrapped in" ". - Did you save before running?
If you edit code without clicking Save, the editor will run the previous version.
Summary & What’s Next
Today, you learned how to issue your very first command in Google Apps Script!
- GAS automates tasks across Google Workspace tools.
Logger.log("text")prints messages to the Execution Log.- Always write code using half-width characters.
Printing a simple string might seem small, but it is the foundational first step for all automation.
Next Lesson: We’ll learn how to read data directly from a cell in a Google Sheet!

