AppsScriptPulse

Apps Script: solutions to the issue “installable triggers failing when created from another trigger function in V8”

There’s a long standing issue with triggers installed programmatically by other triggers, that was kind of fixed last year, but users are still reporting problems, at least in certain locations (Japan, India and others). The issue in short: triggers installed programmatically would not be created, or fail systematically.

In many cases this affects add-ons (and, to be noted, the issue still persists when testing them, see Testing details); I had a slightly different scenario: a webapp that, when executed (doGet), would install a time based trigger for the user executing the script.

This article provides two solutions to an annoying issue and unlocks many possibilities for programmatically installed triggers.

Source: Apps Script: solutions to the issue “installable triggers failing when created from another trigger function in V8”

Quick backup solution for Google Apps Script by creating versions in Google Docs

Get security and peace of mind by backing up your Google Apps Script files to Google Docs and trigger for continuous backup.

We’ve featured a couple of methods for restoring Google Apps Script code in Pulse, but most of these rely on recovering a deployed version of the script. Stéphane Giron wields his Apps Script hammer and skilfully demonstrates how you can use Google Docs and it’s built-in version history as a way of keeping a backup copy of your code.

Source: Quick and not so Dirty backup solution for Google Apps Script Code

Updated Apps Script integrated development environment will replace the legacy experience by Q4 2022 | Release Notes  |  September 27, 2022

Apps Script has turned down the legacy integrated development environment (IDE) in favor of the redesigned IDE that launched in December 2020.

Google have announced the updated Apps Script editor will replace the legacy experience by Q4 2022. Whilst the new IDE was a huge step forward there are some core features from the old Script Editor, which will hopefully make it into the new IDE before Q4. The ones I hear most often are access previous script versions and search/replace across project script files. For the later in the meantime I recommend looking at the Black Apps Script Chrome extension. Whilst this extension primarily enables a true dark mode it also lets you search across script files.

Source: Release Notes  |  Apps Script  |  Google Developers

How to recover an old Google Apps Script version (a no-code solution)

Many of us undisciplined hacks (read: not professional developers) sometimes find ourselves wondering when we will buckle down and start using Github to store our Apps script source files and versions.

If you sometimes find yourself in the same boat: needing to restore or access an old script version, the first thing you probably do is revert back to the old Apps script editor (IDE), (filling out the form regarding the lack of version history as your reason), and then hoping the version queue goes back far enough for you to recover what you need.

Well, today my undisciplined friend, I will show you a way to recover your script files, all the way back to version 1!! Yes, no more switching back to the old code editor.

In Pulse we’ve previously highlighted Romain Vialard’s solution to Retrieve previous versions of Google Apps Script projects, which uses UrlFetchApp to make a call to the Script REST API and add recovered files to your Google Drive. In this new contribution from Clark Lind a clever ‘no-code’ solution using Google’s interactive API Explorer. The post includes all the steps you need to follow if you need to recover an old version of a script project.

Source: How to recover an old script version

Redeploying Web Apps without changing the URL in the new Google Apps Script IDE

Redeploying Web Apps without Changing URL of Web Apps for new IDE

A ‘feature’ of the new Google Apps Script editor is managing your script project the deployments. A issue some developers are encountering when updating the published version of their web app is the published url changes. In this gist Kanshi Tanaike describes the problem and highlights how developers can update their published Web App without changing the URL.

Source: Redeploying Web Apps without Changing URL of Web Apps for new IDE

Adding an unsubscribe link to the Google Workspace Solution Gallery ‘Mail merge using Gmail and Google Sheets’

Recently I came across a nice post from Ravgeet Dhillon, which looked at how to Add Unsubscribe link in emails using Google Apps Script. The solution uses a Google Sheet and a Google Apps Script web app to add an unsubscribe link to emails. As I noted when shared via AppsScriptPulse this is a useful addition if your mailing needs comply with PECR or similar electronic communications regulation compliance.

Having recently updated my ‘Create a mail merge using Gmail and Google Sheets’ in the Google Workspace Solution Gallery to handle inline images I thought it would be useful to show how this example can be extended to include a variation on Ravgeet’s post.

Source: Adding an unsubscribe link to the Google Workspace Solution Gallery ‘Mail merge using Gmail and Google Sheets’

Learn how to build an image library with Google Drive and a little Google Apps Script

With Google Drive, Apps Script, Bootstrap, and a little jQuery, you can develop an Image Library web application with search and download functionality!

Useful little tutorial if you are interested in learning how to interact with Google Drive files. The post is also a nice introduction into using the Bootstrap framework for building responsive web apps.

Source: Image Library

Google Apps Scripts Libraries — How to set them up and turn Slack into a real-time logging platform

This post shows how to setup Libraries in Google Apps Scripts to share code and functions. We will use this while using Slack for logging.

Nice post from Matt “Rudy” Benton on using libraries in your Apps Script projects to make it easier to share code/credentials. Matt illustrates this with a Slack app that has also been documented.

Source: Google Apps Scripts Libraries — How to set them up and turn Slack into a real-time logging platform

Google Apps Script GitHub Assistant (GasHub) updated for the new IDE

GasHub is a popular open source Chrome extension which lets you use GitHub for your code version control. This solution is the creation of @terryleonhart and not an official Google solution and as such there was some backend work to get the tool to work with the new Apps Script editor. This work has now been completed and developers can continue to enjoy using this excellent tool. To install and find out more click through the source link:

Source: gas-github

5 Great Features in the new Google Apps Script Editor for Beginners

The new editor (Integrated Development Environment — IDE) for Google Apps Script is out! There is a lot of features in the new editor to make your lives easier; here’s my top 5 favorites that I think are helpful for beginners to write and manage their scripts.

We’ve reshared a number of community contributions about the new Apps Script IDE, but this is the first we’ve seen that is specifically targeted at beginners. As well as useful functionality within the IDE Cleo also shares some of her tips which should help writing code easier.

Source: 5 Great Features in the new Google Apps Script Editor for Beginners