You don’t need to be an engineer to build an automation
![A robot holding a wrench and pliers](https://pixotech.com/app/uploads/2022/04/robot-600x376.jpeg)
Introduction
![Screenshot of recording macro function in Google Sheets](https://pixotech.com/app/uploads/2022/04/macro-600x296.png)
Can you think of a repetitive computer task that you do every day, or every week? Something so monotonous that it makes you feel like a robot? If you can, then chances are you shouldn’t be doing that task. You are a human, you should be doing human things. Let a robot do the boring, repetitive stuff.
Google Sheets offers a great example of how anyone can become a wizard at automation. Instead of doing that same set of repetitive tasks over and over, why not do that set of tasks just one more time, but record a macro while you’re doing it. When you record and save a macro you’re actually writing a custom function using Google Apps Script. You can open up the Apps Script from the Extensions menu of your spreadsheet and see the code that you’ve written while recording your actions.
If you think that’s neat, try recording a few more macros, then try putting multiple macros together to create a larger function, and maybe try cleaning up those steps to make it run faster. Once your curiosity is sparked, you just might find yourself digging through the reference pages to see what else you can do with your automation. One of my favorites is the toast API call, toast(msg, title, timeoutSeconds), which makes a small pop-up message appear in the bottom right of the spreadsheet. It’s a great way to add a checkpoint notification for that custom function. Or, it’s also a fun way to brighten someone’s day with a cheeky message when they open the spreadsheet.
Here’s one to get you started — paste this function into the script file of that shared spreadsheet. Happy automating!
function onOpen() { // when someone opens the spreadsheet…
var username = Session.getActiveUser().getUsername();
SpreadsheetApp.getActiveSpreadsheet().toast('Hello '+username+', nice to see you again!', 'Incoming Message', 10);
};