AppsScriptPulse

Using Design Patterns in Google Apps Script – Introduction to façade and proxy patterns

A lot of users try and quickly learn GAS and use it to make their lives easier. It’s all great, however the code we sometimes tend to come across on StackOverflow and other sites lacks best practices, hence I thought it was time to start bringing them up and I will start today with design patterns.

As noted by the post author Dmitry Kostyuk the Google Apps Script V8 runtime opens up many new coding opportunities previously not available to Apps Script developers. Using the common use case, fetching data and writing it to a Google Sheet, Dmitry explains how the façade and proxy code patterns can be used to write efficient easy-to-read code.

Source: Using Design Patterns in Google Apps Script

Help! My time triggers are not in sync! : How to update your Google Apps Script project time zone. – Yagisanatode

If you have made it to this post you are probably a little frustrates about why your Google Apps Script time triggers are not running on or around the times that you have designated … To cut to the chase, the likely cause of clock triggers not running in the time range that you have selected is that the time zone in your Google Apps Script project is out.

Scott ‘Yagi’ Donald provides some very useful tips on how you can check and adjust your Apps Script project’s timezone.

Source: Help! My time triggers are not in sync! : How to update your Google Apps Script project time zone. – Yagisanatode

Creating a Google Chatbot connected to SAP Graph API

You know that idea you always keep at the bottom of your backlog for that elusive day you’ll find enough time to address? For me, it’s the possibility to connect a chatbot to an SAP system.

Julien Delvat shares how you can connect the SAP Graph API to Google Chat with Google Apps Script. The post provides details of the entire development and deployment process with useful tips on how you can extend the project.

Source: Creating a Google Chatbot connected to SAP Graph API

🎂 Happy anniversary Google add-ons! 🎂 Long live MERGO the new mail merge add-on from @romain_vialard

Ain’t no party like a mail merge party and Romain Vialard knows how to celebrate!

Control Your Nest Thermostat And Build A Temperature Logger In Google Sheets Using Apps Script

Image: Ben Collins

Image: Ben Collins

If you have a Nest thermostat at home, you can access it from your Google Sheet by using Apps Script to connect to the Smart Device Management API. It means you can do some cool stuff like build a virtual, working Nest thermostat in your Google Sheet

Source: Control Your Nest Thermostat And Build A Temperature Logger In Google Sheets Using Apps Script

Managing Multiple Script Projects Using the Google Apps Script API

This article will discuss how to manage multiple, container-bound script projects using the Google Apps Script API from within Google Apps Script itself.

Interesting write up of how you can manage container bound Apps Script projects from an Apps Script…

Source: Managing Multiple Script Projects Using the Google Apps Script API

Google Apps Script: Store a Unique User Key from a User Accessing your WebApp – Yagisanatode

Google Apps Script: WebApp In this tutorial, we will cover how you can get a unique temporary access key from a user accessing your WebApp that lasts for 30 days. Temporary access keys allow you to track users as they use your WebApp over time while still providing anonymity to the user by providing only an access key to that user.

Source: Google Apps Script: Store a Unique User Key from a User Accessing your WebApp – Yagisanatode

Save PDF from URL directly to Google Drive using Google Apps Script

There is a PDF file on the Internet. Say this one. And you want to save it to your Google Drive. The tedious way is to download it to your computer. … and then upload it to your Google Drive. (Seems like too much work.) If only you could send the PDF straight from where it is stored on the Internet, to your Google Drive…

Nice little snippet which shows how you can add .pdf files to Google Drive.

Source: Save PDF from URL directly to Google Drive using Google Apps Script

Find and clone Apps Script projects from GitHub directly into the IDE with scrviz – Desktop Liberation

I thought it might be useful if you are learning Apps Script to be able to pull in examples to play around with. This latest release adds the ability to configure and clone projects from github directly into the Apps Script IDE.

We’ve previously highlighted Bruce Mcpherson’s visual Google Apps Script explorer tool, ‘scrviz’. If you are not familiar with this it is Bruce has figured a way to search and identify Google Apps Script projects publicly shared on GitHub. In this latest update to the tool you can now clone public Google Apps Script projects from scrviz straight into the Apps Script IDE.

The source link explains more about how you can do this:

Source: Find and clone Apps Script projects from github directly into the IDE with scrviz – Desktop Liberation

Analyze your friends Peloton workout stats with real-time updates (using Google Apps Script)

A tutorial on how you can sync and analyze your Peloton workout stats into Coda with custom dashboards. Sync with a Google Apps Script or serverless function on Google Cloud.

We’ve featured this example from Al Chen on interacting with Peleton data with Google Apps Script before. Al has recently updated the post to include a “new table ‘Friend Workouts’ contains latest 10 cycling workouts from people you follow”. Follow the source link for more details…

Source: Analyze your Peloton workout stats with real-time updates

How to fetch #Mars2020 #PerseveranceRover photos with Google Apps Script

{ APIs } NASA Mars Perseverance rover is now 273 Earth hours on Mars. About 11 Sols (Martian day). Just sitting on Jezero crater and doing all the checks for the great adventure ahead. If you know JavaScript Google Apps Script will can surely help you make those postcard from Mars delivered at your will.

Nice example from Janus Suarez showing you how you can use Google Apps Script to ‘fetch photos from Mars’. In this instance Janus is using the NASA API to collect and email the latest images from Perseverance. The code is available in the post and might be the start of your next fun project.

Source: Mars Rover Photos

Website Status/Monitor Check with Google Apps Script

Is your website currently up and running? Wouldn’t it be nice to get notified if your website was down? Using Google Apps Script and Google Sheets, let’s create something that will check a list of your websites daily and email you if any of them appear to be down.

Nice little website status/monitor solution. The post full documents the code so if you are just learning Apps Script a nice resource.

Source: Website Status Check

Modern Angular in Google Workspace Editor Add-ons

I intend this post for established Add-on developers who want to use Angular in Google Workspace editor Add-ons and Google Apps Script webapps. This does not attempt to show how to create Add-ons or Angular apps, but the tooling and build process to use Angular apps in Add-ons. I am also assuming familiarity with installing and using CLI tools in your development workflow.

We recently had the author of this post, Spencer Easton, on an episode of Totally Unscripted to talk about this topic. This companion post provides an overview of using Angular for Add-on development. There is a cost associated with this solution has separate hosting is required for the Webpacks, but as covered by Spencer the cost is low (for a 100K+ users add-on the cost is $8/month).

Source: Modern Angular in Google Workspace Editor Add-ons

A SyntaxHighlighter Evolved WordPress plugin for Google Apps Script contributors

With my published content I like to include useful code snippets. As I published on a self-hosted WordPress blog I’ve used plugins to help format the code to make it easier to understand and also aesthetically look nice. In this post I share a WordPress plugin I’ve developed for Google Apps Script syntax highlighting.

Source: A SyntaxHighlighter Evolved WordPress plugin for Google Apps Script contributors

Download Gmail Messages as EML Files in Google Drive – Digital Inspiration

This Google Script will help you download your email messages from Gmail to your Google Drive in the EML format.

Nice little snippet from Amit Agarwal for generating .eml files from Gmail messages using Google Apps Script. The post has all the code you need for this.

Source: Download Gmail Messages as EML Files in Google Drive – Digital Inspiration

Subscribe to Apps Script Pulse...