Welcome back to the Hello World in Every Language series. Once again, I get to chat about a code snippet that was shared by someone in the community, Arun Pattni. Thanks to them, we’re able to tackle Hello World in Google Apps Script, a scripting language that first appeared in 2009.
Overall, Google Apps Script appears to be a great tool for anyone looking to write add-ons for G Suite applications. Otherwise, you’ll probably never use it.
Unlike many languages, Google Apps Script code doesn’t need a main function. In fact, all we have to do is define a function. Google handles what we want to do with the script at runtime.
Inside the code block, we have our typical print call. In this case, we leverage the Logger to do our printing. Then we pass our “Hello, World!” string to the log function, and call it a day.
If we want to run Hello World in Google Apps Script, we actually have to write our scripts using the Apps Script tool. From there, Google has some nice documentation for running them.
Alternatively, we can write scripts locally and upload them to Google Drive. At that point, we can connect the Google Apps Script tool to run our scripts. The link above has directions for that option as well.
If you know of other ways to run Google Apps Script code, let me know in the comments.
And, that’s it for Hello World in Google Apps Script. If you want to contribute to this language, consider forking the Sample Programs repository.
As always, thanks for stopping by and a special thanks to Arun Pattni for their contribution to the series. Every little bit helps!
While I have you here, consider sharing this article. I’m sure your friends will enjoy the series, and they might even want to contribute.