AppsScriptPulse

Retrieve previous versions of Google Apps Script projects

Photo by James Lee on Unsplash

Retrieve the source code linked to a specific version of your Apps Script project then save it as a new Apps Script project – RomainVialard/access-code-of-older-versions

Neat solution from Romain Vialard to retrieve a previous version of your Apps Script code. There is an open feature request to have this as a built-in feature of Apps Script (as noted by Romain recovering a previous script version is also possible using clasp using pull and an optional version number).

Source: RomainVialard/access-code-of-older-versions

RichTextApp – a Google Apps Script library for copying rich text formatting from Google Docs and Sheets

This is a GAS library for copying the rich text with the text styles from Google Document to Google Spreadsheet or from Google Spreadsheet to Google Document using Google Apps Script (GAS). And, also the rich texts in the cells can be converted to HTML format.

Nice little helper library for copying rich text formatting from Google Docs and Sheets. You can view the project README for information on the formats that are currently supported. Personally,  the inclusion of the RichTextToHTMLForSpreadsheet method looks particularly useful for converting rich text formatting in Google Sheets cells to HTML for mail merge applications.

Source: tanaikech/RichTextApp

Taking Advantage of Google Apps Script (Tanaike’s list)

Kanshi Tanaike is a prolific Google Apps Script developer and we’ve often featured solutions are reports that Tanaike has shared. With this in mind Tanaike’s list of Google Apps Script resources is well worth a browse.

Source: tanaikech/taking-advantage-of-google-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

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

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

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

Things one can get used to for the V8 Google Apps Scripts engine

A bit of a monologue about various syntax changes and adjustments in learning and using the tool.

Great post from Adam Morris (@clssrmtechtools) aimed at Google Apps Script developers wanting to start coding with the more modern JavaScript syntax used in V8. Adam shares lots of great advice to get started and build upon.

Source: Things one can get used to for the V8 Google Apps Scripts engine

Benchmark: Loop for Array Processing using Google Apps Script with V8

Benchmark: Loop for Array Processing using Google Apps Script with V8 – submit.md

Kanshi Tanaike has published some useful benchmarks looking at the process time for various loop methods comparing the old Google Apps Script runtime with V8. Something to keep in mind that while there are performance improvements there is a cost as calls to G Suite services:

Source: Benchmark: Loop for Array Processing using Google Apps Script with V8

TeslaGAS is a Google Apps Script library that helps writing scripts for your Tesla car

Photo by Afif Kusuma on Unsplash

Photo by Afif Kusuma on Unsplash

TeslaGAS is a library that helps writing scripts that communicate with your Tesla – Zzapps/teslagas

Riël Notermans from Zzapps has published the beginnings of a nice little Google Apps Script library that you can use to communicate with your Tesla car.

Source: Zzapps/teslagas

Google Apps Script snippet for Google Sheets to view json strings in a modal dialog

View json strings in a modal dialog

View json strings in a modal dialog. Activate the cell that contains a JSON string Click menu item A foldable JSON will be shown in the modal dialog

Handy little Google Apps Script snippet from Riël Notermans (Zzapps) that makes it easier to view any JSON you are storing in a Google Sheets cell.

Source: Zzapps/google_sheets_json_viewer

List of over 130 shared Google Apps Script libraries developed by Bruce Mcpherson

Regular Google Apps Script Community contributor Bruce Mcpherson has published a list of all the Google Apps Script libraries he’s developed since 2012. The list includes links to the source repositories and if you spot a library you like the sound of you can search for more information on Bruce’s Desktop Liberation site .

Source: List of shared Apps Script libraries · Issue #31 · brucemcpherson/desktopliberation

Make your own Google Hangouts Chat RSS bot

A simple Google Apps Script bot that fetches news from an RSS feed and posts them to a Hangouts Chat room. – thmslprt/hangouts-chat-rss-bot

This one comes via @dersteppen and is a nice little code project to show how you can send messages into Google Hangouts Chat using Google Apps Script. If you are looking for a more secure way of posting into Hangouts Chat the official docs include information on Async messages.

Source: thmslprt/hangouts-chat-rss-bot

Write Apps Script Offline with clasp

🗺️ Develop Locally: clasp allows you to develop your Apps Script projects locally. That means you can check-in your code into source control, collaborate with other developers, and use your favorite tools to develop Apps Script.

Source: google/clasp

The Apps Script IDE is great, but with larger projects, I know I’ve wanted to be able to use a more powerful IDE. clasp (Command Line Apps Script Projects) is a CLI that allows you to start, write, test, and deploy Apps Script projects from any text editor you want.

Resumable Upload For Google Drive with Google Apps Script Example

This is a Javascript library to achieve the resumable upload for Google Drive. When a file more than 5 MB is uploaded to Google Drive with Drive API, the resumable upload is required to be used.  tanaikech/ResumableUploadForGoogleDrive_js

Kanshi TANAIKE has some amazing GitHub contributions and this is another one. Whilst this is designed as a Javascript library you can use in any project Kanshi provides and an example of how this could be used in a Google Apps Script add-on.

Source: tanaikech/ResumableUploadForGoogleDrive_js

BkperApp – An example 3rd party client library for Google Apps Script 

Google Apps Script library for Bkper.

Bkper “provide a simple way to work with Finances and Accounting on Google Cloud”. The BkperApp is a Google Apps Script library they have published so that other developers have an easy way to interact with the Bkper API. There are a couple of reasons for highlighting BkperApp. First it’s great to see a company invest in developing and publishing a Google Apps Script library for their product. The BkperApp code is worth looking at because the code has been developed in clasp using TypeScript. Finally the code is open source (Apache License 2.0) so if you are thinking of developing a library for your own product BkperApp might provide a useful starting point in terms of how you structure your project.

Source: bkper/bkper-app

The Google Apps Script Awesome List – Alexander Ivanov

The usual list of links to interesting resources for Google Apps Script – contributorpw/google-apps-script-awesome-list

Alexander Ivanov has been curating this amzing list of Google Apps Script related resources for a number of years. The list includes links to a number of useful resources, cool Apps Script code projects, libraries and more.  If you have a suggestion for the ‘awesome list’ you can open an issue ticket.

Source: contributorpw/google-apps-script-awesome-list

Subscribe to Apps Script Pulse...