AppsScriptPulse

Theatre by email: This unique virtual project lets you ‘teach’ an AI how to feel | CBC Arts

As part of the Rex Project, the audience is emailed collages like this one. It illustrates the details from the AI's "simulation reports." (The Rex Project)
As part of the Rex Project, the audience is emailed collages like this one. It illustrates the details from the AI’s “simulation reports.” (The Rex Project)

It’s a one-man operation, so it’s just me. I’ve been playing around in Google, and they have a really cool service called Google Apps Script, and basically it’s a little programming language that lets me automate their services. So I’ve been writing a code that triggers the emails.

There’s not much detail as to how Apps Script was used in this art installation but it’s always nice to see script and art combine. The project is described as:

In a futuristic world, where the integration of human memories and computer cores has created artificially intelligent androids, companies are mass-recruiting employees to fast-track production. You, the listener, are hired to be an integral part of the quality-control in the emotional development sector. The Rex Project (workshop presentation) is an immersive, virtual, bite-size theatrical experiment that takes place in real time (over 11 days), and is presented entirely through audio-recordings and online platforms.

Rex Project

Source: Theatre by email: This unique virtual project lets you ‘teach’ an AI how to feel | CBC Arts

Dear Analyst #31: Writing Google Apps Scripts to sync data from Coda to Google Sheets • KeyCuts Blog

Use cases for Google Apps Script include syncing data from Coda to Google Sheets.

Always nice to see other products promoting integrations to Google with Google Apps Script. In this post/podcast Al Chen links to a detailed tutorial and code for syncing data to and from Google Sheets to Coda. If you aren’t familiar:

Coda brings all of your words and data into one flexible surface. Coda comes with building blocks—like tables and buttons—and time-saving templates, so your doc can grow and evolve with the needs of your team.

Follow the link through to the source for code and more details.

Source: Dear Analyst #31: Writing Google Apps Scripts to sync data from Coda to Google Sheets • KeyCuts Blog

Building a Gmail Add-on with Apps Script

I recently sent an email where I typed code inline in the message body. I spent a good 15 minutes going through and formatting each line of code to look like, well, code. I wanted an extension like Code Blocks that would instantly format my text to a specific preset style.

A well chronicled article by Kelsey Kripp on how to dive right into Apps Script for G Suite to build your own Gmail add on!

Source: Building a Gmail Add-on with Apps Script

Change Tab Detection on Google Spreadsheet using onSelectionChange Event Trigger with Google Apps Script

Change Tab Detection on Google Spreadsheet using onSelectionChange Event Trigger with Google Apps Script – submit.md

An example script from Kanshi TANAIKE which lets you test the new onSelectionChange(e) simple event trigger in Google Sheets.

The onSelectionChange(e) trigger runs automatically when a user changes the selection in a spreadsheet.

In the example shared this is used to detect the user changing Google Sheet tab.

Source: Change Tab Detection on Google Spreadsheet using onSelectionChange Event Trigger with Google Apps Script

Fast, operational, and awesome prototypes with Google App Scripts and the Airtable API

As of writing Google App Scripts and functions in the code.gs documents use the V8 Runtime which generally supports ES6 syntax. This wasn’t true historically, and Google Scripts was limited ES5 syntax. This was a significant limitation. You’ll likely still find a lot of tutorials for Google App Scripts using ES5 and related workarounds, keep in mind there may be more modern ways to do the same thing now.

If your teams are using G Suite tools and Airtable, the building blocks to build secure and operational web application prototypes may be closer than you think. This article shows you how to get started and offer tips along the way.

Source: Fast, operational, and awesome prototypes with Google App Scripts and the Airtable API

Interacting with multiple hyperlinks in Google Sheets cells with Google Apps Script

Before this, when a cell has only one hyperlink. In this case, the hyperlink was given to a cell using =HYPERLINK(“http://www.google.com/”, “Google”) but by a recent update, a cell got to be able to have multiple hyperlinks … In this report, I would like to introduce the method for setting and retrieving the multiple URLs for a cell.

Hyperlinks in Google Sheets cells is a bit of an obsession of mine and it’s nice to see Kanshi TANAIKE has a similar passion. Google are rolling out multiple hyperlinks in Google Sheet cells and Tanaike has provided details on how the hyperlink values can been get/set with Google Apps Script (the official docs are still catching up with Tanaike’s discovery :)

Source: Updated Specification of Google Spreadsheet: Multiple Hyperlinks to a Cell

Fake calling to leave one meeting for the next — Google Apps Script to the rescue

All through the day, I want call reminders for specific events 10 mins before the meeting time, so I can leave my current meeting with out a hitch and go for the next one. So I used 3 tools for this: Google Calendar to fetch meeting times, Google Calendar to fetch meetings. Twilio to make calls. And finally Google Apps Script to put it altogether.

An interesting implementation by Urwa Shabir on managing meeting schedule using Twilio, Google Calendar and Apps Script.

Source: Fake calling to leave one meeting for the next — Google Apps Script to the rescue

The Gift of Script: Create a Shortcut in Google Drive with Google Apps Script

The following Google Apps Script is designed to create a Shortcut to an existing Google Drive folder, within another folder..

For Google Drive pros you can currently place a file in multiple folders, but Google will be removing this functionality on 30 September 2020. In March Google announced general availability of shortcuts in Google Drive, is is designed to replace the ‘file in multiple locations’ feature. For Google Apps Script developers wanting to migrate to Drive Shortcuts Phil Bainbridge provides this useful Apps Script snippet.

Source: The Gift of Script: Create a Shortcut in Google Drive

Google Apps Script: Upload grades into a Google Classroom Coursework Assignment – Yagisanatode

Google Classroom has become one of the darlings of the teaching world that has come out of this crisis. Its shallow learning curve and attractive UI made it an obvious choice for most educators. Oh, and I am sure the fact that it is free helped too.
One of the limitations is that you cannot simply upload grades from, say Google Sheets or another assessment tool. Well…not directly in the Google Classroom platform, yet.

This tutorial runs through the basics of uploading grades from Google Sheets into Google Classroom using Google Apps Script with the Classroom API.

Source: Google Apps Script: Upload grades into a Google Classroom Coursework Assignment – Yagisanatode

Code Blocks – Syntax Highlighting for Google Docs

Syntax highlighting for Google Docs

With the Code Blocks add-on for Google Docs you can create formatted code blocks using a wide variety of themes and language support for syntax highlighting. This is a great add-on for anyone wanting to create technical training materials in Google Docs.

Source: Code Blocks – G Suite Marketplace

DNSQuery and G Suite domain detection in Google Sheets using the Cloudflare name resolution service

Dos funciones personalizadas para hojas de cálculo de Google desarrolladas en Apps Script que proporcionan un envoltorio para la función NSLookup, tal y como aparece en la documentación del servicio de resolución de nombres de CloudFlare. Consulta el registro indicado en el o los dominios que se pasan como parámetro utilizando el servicio de resolución de nombres de CloudFlare. Determina si un email o dominio (o lista de emails o dominios) está gestionado por Google o no. – pfelipm/dnsquery

Pablo Felip Monferrer has shared two custom functions for Google Sheets that provide an extension to the NSLookup function originally shared by Cloudflare. The first is a wrapper that makes it easy to list specific DNS record types for a single or list of domains. The second function uses the domains MX record to automatically detect if a domain has G Suite Gmail settings applied.

Source: pfelipm/dnsquery

Docs to Markdown Add-on

Drive add-on that converts a Google Doc to simple, readable Markdown or HTML.

This add-on is helpful for anyone doing technical writing or producing technical content. With Docs to Markdown, you can easily export the content of your Google doc for publication on a variety of other web-based platforms or CMSs.

Source: Docs to Markdown – G Suite Marketplace

Marketing Data Extraction using SOAP API — Apps Script Automation

Recently I had setup a daily extraction automation from a marketing platform and they had SOAP API. I had worked with xml before, so after some trial and error I was able to fetch marketing data from trafficvance.com platform right inside Google Sheets

Nice post from Urwa Shabir highlighting how to interact with 3rd party APIs using SOAP which relies heavily on XML. The post covers formatting a SOAP request now that SOAPService is deprecated in Apps Script, as well as parsing the XML response.

Source: Marketing Data Extraction using SOAP API — Apps Script Automation

DNS in Google Sheets – Cloudflare Resolver

They thought we wouldn’t go there, but they thought wrong. If you want or need to find out some DNS records inside of Google Sheets, create a Google Function

Eric Koleda spotted (see tweet) that Cloudflare has been having some fun with Google Apps Script sharing a custom function that lets you do a DNS lookup for domain names in Google Sheets. Eric notes he can’t imagine when you would need to do this, but I always find it encouraging to see big companies using and promoting Google Apps Script.

Source: DNS in Google Sheets – Cloudflare Resolver

Hacking it: Generate PDFs from Google Forms

Some time ago, I had a request from one of my colleagues to help automate a rather repetitive and might I add, highly prone to error, process. One of the clients required her to fill in the same form several times in a day, manually, and then send it back for approval and signing. Of course, I’m simplifying a bit but that was what it was in essence.

In this detailed post, Neha demonstrates how to use Google Forms to generate professional looking PDFs from the data submitted via the form, using Google Sheets and Apps Script.

Source: Hacking it: Generate PDFs from Google Forms

Delegating Client-Side Requests with google.script.run in Google Apps Script – Jeff Everhart

After a while, writing code becomes less about knowing all of the specifics of a language, framework, or platform, but more about being able to match patterns. After seeing a sufficient number of different problems, you get better at saying, “Hey, this bit of problem X seems a lot like this part of problem Y, maybe we could use that.”

In this post, learn about the Delegation Pattern that describes an object whose role it is to accept requests, delegate those responses to other objects, then return the responses to the original caller.

Source: Delegating Client-Side Requests with google.script.run in Google Apps Script – Jeff Everhart

Proof of concept of how to get namespaces (sorta) in Google Apps Scripts libraries

Proof of concept of how to get namespaces (sorta) in Google Apps Scripts libraries – classroomtechtools/NamespacedLib

For the seasoned Google Apps Script library author a continual frustration is the inability to get the online Script Editor to autocomplete if you have sub methods within your namespace. Adam Morris has discovered that the @name attribute can be used to fake this behavior … to a degree.

Source: classroomtechtools/NamespacedLib

Firefast is a Firebase SDK for Apps Script V8 Runtime. Read and write data in Firebase using Google Apps Script

Firebase Realtime Database is a cloud-hosted NoSQL database. Data is stored as JSON and can be accessed in your Web, iOS, Android app using Google’s Firebase SDK. But, Google doesn’t provide such SDK for Apps Script. This library solves that problem. It gives you Firebase SDK for Apps Script.

Nice Google Apps Script library from Mani Doraisamy that makes it easy to read/write data from a Firebase Realtime Database. The site also highlights the performance gain of writing this library from the V8 runtime compared to the older FirebaseApp library shared by Romain Vialard. Mani’s code is open source and if you have issues, feedback or contributions you can add these via the Github repo.

Source: Firefast – Getting Started

How to make a Ladder Card game with Apps Script

In our foreign language classes, one of the classic activities we do to help students learn new language, is to print phrases onto card, then cut the cards up. We then write the answers on the back of the cards. They then place the cards on a desk and then go through the cards one by one, trying to remember the correct answer.

Here we’re going to make a simple ladder card game using Apps Script and Google Sheets.

Source: How to make a Ladder Card game with Apps Script

Streamline access to resources for vendors via Google Sheet – Sheets to Apps

Need to share a variety of documents with vendors? Don’t want to share access one by one? In this episode of Sheets to Apps, we’ll cover how to use an Apps Script in a Google Sheet to automatically add members to a Google Group, helping you share documents at a large scale that will save you time.

We’ve previously shared the Medium post that provides more details for setting up this solution. If you missed that post or were unclear Alexandrina Garcia-Verdin, better known in the community as AGV, provides a very useful overview.

The code and other resources presented in this episode are available from the video description.

Subscribe to Apps Script Pulse...