How to Automate Routine Tasks in Google Workspace with Simple Scripts
Ever felt like you’re stuck in a loop of copy‑pasting, moving files, or sending the same email over and over? You’re not alone. In a world where every minute counts, even the tiniest repetitive chore can drain our energy. The good news? Google Workspace lets you write tiny programs—called Apps Scripts—that can take those chores off your plate. In this post, I’ll walk you through three everyday automations that anyone can set up, no PhD in computer science required.
Why Automation Matters Right Now
Remote work has turned our inboxes and shared drives into the new office hallway. The more we rely on Google Docs, Sheets, and Slides, the more we see the same patterns repeat. Automating those patterns frees up brain space for creative work, and it also reduces the chance of human error. Think of it as giving yourself a digital assistant that never asks for a coffee break.
Getting Started: The Basics of Apps Script
What is Apps Script?
Apps Script is a lightweight, JavaScript‑based language that lives inside Google Workspace. It can read, write, and move data across Docs, Sheets, Slides, Gmail, and Drive. The best part? You write the code directly in your browser, hit “Run,” and watch it work.
Where Do I Write It?
Open any Google Sheet, click Extensions > Apps Script. A new tab opens with a simple code editor. The default file is called Code.gs. “gs” stands for Google Script. From here you can start typing or paste a ready‑made snippet.
Permissions
The first time you run a script, Google will ask you to grant permission. This is normal—your script needs access to the services it talks to (like Gmail or Drive). Just read the prompts, click “Allow,” and you’re good to go.
Automation #1: Auto‑Archive Old Emails in Gmail
The Problem
Your inbox is a mess of newsletters, project updates, and old client threads. Manually moving each message to an “Archive” label takes forever.
The Solution
A short script can scan your inbox for messages older than a set number of days and apply a label, then archive them. Here’s a simple version:
function archiveOldMails() {
var days = 30; // change to whatever age you prefer
var cutoff = new Date();
cutoff.setDate(cutoff.getDate() - days);
var threads = GmailApp.search('in:inbox before:' + Utilities.formatDate(cutoff, Session.getScriptTimeZone(), 'yyyy/MM/dd'));
for (var i = 0; i < threads.length; i++) {
threads[i].addLabel(GmailApp.getUserLabelByName('Auto‑Archive'));
threads[i].moveToArchive();
}
}
How It Works
- Set a threshold –
daystells the script how old a message must be. - Create a date –
cutoffis today minus that many days. - Search Gmail – The
searchmethod uses Gmail’s own query language (before:) to find matching threads. - Label and archive – Each thread gets the “Auto‑Archive” label and is moved out of the inbox.
Running It Automatically
Go to Triggers (the clock icon on the left), click “Add Trigger,” choose archiveOldMails, set the event source to “Time‑driven,” and pick a daily schedule. Now your inbox cleans itself while you sip your morning coffee.
Automation #2: Sync a Master Sheet to Team Folders in Drive
The Problem
Your team uses a master spreadsheet to track project status, and each project has its own folder in Google Drive. Every time a new project is added, you have to manually create a folder and share it with the right people.
The Solution
A script that watches the master sheet for new rows and creates a matching folder automatically.
function onEdit(e) {
var sheet = e.source.getActiveSheet();
if (sheet.getName() !== 'Projects') return; // only run on the Projects tab
var range = e.range;
if (range.getColumn() !== 1) return; // assume column A holds the project name
var projectName = range.getValue();
if (!projectName) return;
var folder = DriveApp.createFolder(projectName);
// Optional: share with a group
var groupEmail = '[email protected]';
folder.addEditor(groupEmail);
}
How It Works
- Trigger type – This uses an
onEditsimple trigger, which fires every time someone edits the sheet. - Check the sheet – We make sure we’re on the right tab and column.
- Create the folder –
DriveApp.createFoldermakes a new folder with the project name. - Share it – Adding a group as an editor gives the whole team access instantly.
A Little Gotcha
Simple triggers can’t run actions that require extra permissions (like sharing with external users). If you need that level of control, convert the function to an installable trigger via the Triggers menu and grant the extra scopes.
Automation #3: Populate a Google Slide Deck from a Sheet
The Problem
Every week you need to present a status update. The data lives in a Sheet, but you spend half the meeting copying numbers into a Slide deck.
The Solution
A script that pulls the latest rows from a Sheet and writes them into placeholders on a Slide deck.
function updateSlideDeck() {
var sheet = SpreadsheetApp.openById('YOUR_SHEET_ID').getSheetByName('Summary');
var data = sheet.getRange('A2:B5').getValues(); // adjust range as needed
var deck = SlidesApp.openById('YOUR_SLIDE_DECK_ID');
var slide = deck.getSlides()[0]; // first slide
// Assume you have two text boxes named {{Metric1}} and {{Metric2}}
var placeholders = slide.getPageElements().filter(function(el){
return el.getPageElementType() === SlidesApp.PageElementType.SHAPE;
});
placeholders.forEach(function(shape){
var text = shape.asShape().getText().asString();
if (text.includes('{{Metric1}}')) {
shape.asShape().getText().setText(data[0][0]); // first metric
} else if (text.includes('{{Metric2}}')) {
shape.asShape().getText().setText(data[0][1]); // second metric
}
});
}
How It Works
- Grab the data –
getRangepulls the cells you need. - Open the deck – Use the deck’s ID (found in the URL) to access it.
- Find placeholders – The script looks for shapes that contain
{{Metric1}}style tags. - Replace text – It swaps the placeholder with the actual value.
Running It on a Schedule
Set a time‑driven trigger for every Monday morning. By the time you walk into the meeting, the deck is already up‑to‑date. No more “let me copy that quickly” scramble.
Tips for Keeping Your Scripts Tidy
- Name your functions clearly –
archiveOldMailstells you exactly what it does. - Comment sparingly – A short comment above each block helps future you.
- Use version control – In the Apps Script editor, click “File > Manage Versions” before making big changes.
- Test on a copy – Clone a Sheet or Drive folder before running a script that moves or deletes items.
When to Stop Automating
Automation is a tool, not a goal. If a task only happens once a quarter, the time you spend writing a script might outweigh the time saved. Also, keep an eye on Google’s quota limits (e.g., how many emails you can send per day). Exceeding them can cause your script to fail mid‑run.
A Personal Note
I remember the first time I wrote a script to clean up my Gmail. I set the age threshold to 7 days by accident and watched a flood of messages disappear. Panic turned into a laugh, and I quickly added a safety check. That little mishap taught me to always start with a small test batch. Now I have a whole library of “safe” scripts that I share on Workspace Wizardry, and I love hearing how they free up time for my readers.
Automation isn’t about replacing human work; it’s about handing the boring bits to a reliable robot so you can focus on the parts that need your unique insight. Give one of these scripts a spin, tweak it to fit your flow, and watch the extra minutes add up.
- → 5 Automation Hacks to Streamline Remote Collaboration Today @remoteaitoolbox
- → Automate Your Daily Coding Tasks with Simple Scripts: A Step‑by‑Step Guide @techsolutionshub
- → Maximizing Your Time: Automation Tools Every Side‑Hustler Should Use @sidehustlehub
- → Automating Daily Tasks with Python: Scripts That Save You Hours @techtrekker
- → A Step‑by‑Step Tutorial: Automating Your Daily Tasks with Zapier @techreviewhub