Image
Apps Script

Use Apps Script libraries directly from Node

Now you can write native Apps Script to run on Node and use existing Apps Script libraries directly. Gas-fakes can now read manifest files and pull in and execute Apps Script libraries right in your Node Apps.

This allows you to use shared Apps Script as part of a Node app (rather like importing modules from npm), or use gas-fakes to develop and test code intended to run on live Apps Script, even if the project includes libraries resident on live Apps Script […]

upstash gas-flex-cache
Apps Script

Sharing cache and properties between gas-fakes and live apps script

How to integrate gas-fakes (Node-based Apps Script emulation) with the gas-flex-cache library, using a shared Upstash Redis backend to enable cross-platform sharing of Apps Script’s Cache and Property stores between your local Node environment and live Apps Script projects. […]

Image
Apps Script

How to allow access to sensitive scopes with Application Default Credentials

Struggling to use Application Default Credentials (ADC) for Google APIs like Gmail or Drive during local development? If you’ve hit the ‘Google blocked access’, learn the critical steps in the Google Cloud Console to create a custom Desktop Client ID and properly authorize your local Node.js application, finally restricted access for your development workflow. […]

Image
Apps Script

Apps Script development with gas-fakes-mcp

The gas-fakes-mcp project is an experimental setup that integrates the Gemini CLI with Google Workspace automation (Sheets, Drive) by utilizing the @mcpher/gas-fakes library. It effectively creates a local, sandboxed environment using Node.js where Google Apps Script (GAS) code can be generated, run, and tested via natural language prompts in the command line. This architecture employs the Model Context Protocol (MCP) to establish a bridge between the local terminal and the Google Cloud APIs, enabling developers to write, execute, and verify native Apps Script logic safely without leaving their local development environment. […]

Image
Apps Script

Supercharge Your Google Apps Script Caching with GasFlexCache

Are you hitting the limits of Google Apps Script’s built-in CacheService? Tired of the 6-hour expiration and restrictive size limits?

GasFlexCache provides a flexible, drop-in caching layer that connects your Apps Script projects to a powerful, persistent, and scalable Redis database. […]

trying to coral all the indices
API Specific

Inside the volatile world of a Google Document

Explore the complexities of Google Docs’ internal structure and how Google Apps Script handles document manipulation. The challenges of managing dynamic content through indices and statefulness, comparing DocumentApp with the Docs API. Learn about stateless vs. stateful systems, and the disconnect between API and DocumentApp. How to use named ranges to maintain element identity and how this helped to enable emulating the Apps Script environment on Node. […]

another gas-fakes structure - enums
Apps Script

All about Apps Script Enums and how to fake them

For my gas-fakes side project (A proof of concept implementation of Apps Script Environment on Node) i needed to reverse engineer Apps Script services so you can write synchronous code on Node to call them exactly as you would in the Apps Script IDE. One of the fundamental structures is the Enum, which are standard across all services.
There’s now both an Apps Script library and npm module available to create them. […]

pushing the code up the hill
API Specific

Apps Script Services on Node – using apps script libraries

I started working on faking Apps Script Services (gas-fakes) on Node as a background project a little while ago. Now it’s 9 partially implemented services and (Total passes 1614 (100.0%)) individual platform comparison tests later. I figured it was time to see if I could port an Apps Script library that uses these services to Node […]

gassypedia jan 2025
Apps Script

Gassypedia – January 2025 update

Time for the first, more or less quarterly, update on the shared bigquery dataset all about the Apps Script ecosystem on Github, with reports available on looker. For details of how it all works see […]

emits , listens waits for and handles cool tones illustration
Apps Script

An event emitter for Apps Script

If you use Node or do any front end development you’re probably already familiar with the idea of event emitters. You’ve assigned listeners handlers for interesting events that occur within your app. You most usually […]

color strip deduplication
Apps Script

Color Vector embeddings vs Video Intelligence API labelling

In Making a film color DNA I described how I was using both color strips and labelled content to find videos that were duplicates or similar. I’m already using ElasticSearch to disambiguate films using labels and object tracking artefacts identified by the Google Video Intelligence API. The next step is to enhance that similarity matching using the color strips of a film as finger prints. […]

convert pdf to multiple images
API Specific

Manipulating PDFS in Apps Script

If you’ve used my Convert any file with Apps Script you’ll know that it can take a wide range of files (currently 53 different mimeTypes, 42 types of imports, and 26 kinds of exports) and […]

js proxy
Apps Script

Extending a cache client with a proxy

Extend a client library object by proxying and intercepting calls to its native methods. This example adds functionality to a redis client, and also gives tips on using GCP secret manger for configuration. […]

filmid
Apps Script

Proxy magic with Google Apps Script

I’ve written a few articles on here about JavaScript proxy and reflect. I use both extensively not only in Node projects but also in Apps Script. In this article I’ll demonstrate how to extend built-in […]

Detect fake news AI generated
API Specific

Detect fake news with Google Fact Check tools

I came across Google’s FactCheckTools API today, so I thought it might be fun to add to my bmApiCentral Apps Script library. This API can be used to both search popular fake news claims and […]

random contrasting font colors
Apps Script

Calculate contrasting font colors for Sheets.

If you are playing around with Sheet colors with Apps Script, you sometimes find yourself with font colors that don’t go well with the background colors you’ve chosen. However, we can use Yiq values to […]

Superfetch plugin
Apps Script

SuperFetch caching: How does it work?

SuperFetch is a proxy for UrlFetchApp with additional features such as built-in caching – see SuperFetch – a proxy enhancement to Apps Script UrlFetch for how it works and what it does. This is another […]

superfetch tank drive
Apps Script

SuperFetch plugins: Tank events and appending

Tank and Drv are SuperFetch plugins to emulate streaming and use the Drive REST API with Apps Script. SuperFetch is a proxy for UrlFetchApp with additional features – see SuperFetch – a proxy enhancement to Apps […]

superfetch tank apps script streaming
Apps Script

SuperFetch Tank Plugin: Streaming for Apps Script

Tank is a SuperFetch plugin to emulate streaming with Apps Script. SuperFetch is a proxy for UrlFetchApp with additional features – see SuperFetch – a proxy enhancement to Apps Script UrlFetch for how it works […]

Goa Oauth2 for Apps Script
Apps Script & Java Script

Apps Script Oauth2 library Goa: tips, tricks and hacks

Motivation Goa is a library to support OAuth2 for Apps Script connecting to a variety of services, using a variety of Authentication flows and processes. There are plenty of other articles on Goa on this […]

goa twitter oauth2 apps script
Add-ons

Apps Script Oauth2 – a Goa Library refresher

It’s been a few years since I first created the Goa library. Initially it was mainly to provide OAuth2 authorization and authentication to be able to access Google APIS and services unavailable via App Script. […]

SuperFetch
Apps Script

SuperFetch plugin – Firebase client for Apps Script

Frb is a SuperFetch plugin to easily access a Firebase Real time database. SuperFetch is a proxy for UrlFetchApp with additional features – see SuperFetch – a proxy enhancement to Apps Script UrlFetch for how it […]

Image
Apps Script & Java Script

Iterator magic – Splitting an array into chunks

It’s a pretty common requirement, especially when you’re posting to an API, to split an array of data into manageable chunks, and most often the solution is to make an array of arrays – with […]

Image
Add-ons

Add-on for decrypting columns in Google Sheets

In Merging sheets from multiple sources and encrypting selected columns I published some code for selectively copying columns from multiple input spreadsheets/sheets to create summary sheets, and optionally encrypting columns. The idea was to distribute the […]

Add-ons

Refreshing an oauth token in add-on

It’s very convenient to use ScriptApp.getOAuthToken() in an addon to reuse the token from the server side in your client side add-on code. However, these have a limited time to live (1 hour), so what […]

apps script v8
Apps Script

Proxy implementation of Apps Script GraphQL Class

In Resuscitating the Apps Script execution transcript – JavaScript Proxy and Reflect to the rescue I showed how we could use the ES6 Proxy global object to intercept calls to Apps Script services so we could […]

apps script crusher on github
Apps Script

Github as an Apps Script cache platform

Github as an Apps Script cache platform Another plugin available for Apps script library with plugins for multiple backend cache platforms so we can use Github as a back end for caching large objects across […]

upstash graphql explorer
Apps Script

Upstash as an Apps Script cache platform

Upstash as an Apps Script cache platform Upstash is a brand new service offering a serverless redis over https  via a GraphQL  API. Previously redis was hard to use along with Apps Script since we […]

info card on hover or click
Apps Script

4 ways to customize scrviz info card behavior

Info Card customization By default the info card appears when you hover over a node in the scrviz visualization. Although the info card is they key tool for investigating scrviz entries, it can be annoying […]

Image
Apps Script

Enrich your developer profile on scrviz

In Showcase your Apps Script work and get hired via vizzy I showed how scrviz could be used to show off your Apps Script work to potential clients, so they could see what kind of […]

gapi and vuex
Apps Script & Java Script

Google gapi, Vue and Vuex together

JavaScript authentication with Gapi is both impressive and frustrating. Frustrating because in most of the examples you come across, and indeed in Google’s own guides, gapi is the center of the universe.  They are about […]

Add-ons

Handly helper for fiddler

If you use some of my libraries, you may have come across  the Fiddler class, which abstracts sheet data and provides a more functional way to manage data from multiple sheets in a Google Spreadsheet. […]

apps script v8
Apps Script & Java Script

Apps Script V8: Keystore for global space

One of the challenges with Apps Script V8 compared to Rhino is that you can’t be sure of the order of global variable initialization. Personally, this is not an issue for me, as I avoid […]

apps script v8
Apps Script & Java Script

Qottle recipe: Managing asynchronous queues with duplicates

Qottle recipe for managing asynchronous queues with duplicates Qottle is a queue for asynchronous tasks with prioritization, ratelimit, and concurrency support. It can also detect and reject duplicate requests. This recipe shows an example of […]

apps script v8
Apps Script & Java Script

Qottle recipe: How to manage an asynchronous polling queue

  Qottle is a queue for asynchronous tasks with prioritization, ratelimit, and concurrency support. This recipe shows an example of a qottle queue for continuous, controlled polling. Qottle recipe for polling You can use qottle […]

Image
Apps Script & Java Script

Goa v8 changes and enhancements

v8 and other htmlservice changes meant I had to make a few small changes to cGoa. The good news it’s easier to use than ever, and supports a few new services too. It’s best to look at the service list on github, as that’ll be kept up to date. Here’s a reminder of how to use it.  […]

apps script v8
Apps Script v8

Apps Script V8: Arraybuffers and Typed arrays

Apps Script V8 implements ArrayBuffers and Typed arrays from ES6. If you’ve used Apps Script Crypto Utilities or done any work with Blobs, then this is what’s going on behind the scenes, now exposed as […]

apps script v8
Apps Script v8

Apps Script V8: Maps and Sets

Apps Script V8 implements a couple of useful new ES6 structures – Maps and Sets. Here’s what they are and how to use them Maps and Sets: What are they? These are a collection of […]

apps script v8
Apps Script v8

Apps Script V8: Template literals

V8 adds template literals from  JavaScript ES6. Template literals: What are they? It’s a shorthand way of using a template into which variables are substituted in a string. This allows for better reuse of string […]

apps script v8
Apps Script v8

Apps Script V8: spreading and destructuring

Apps Script V8 adds destructuring from  JavaScript ES6. Legacy Apps Script already had destructuring of arrays added fairly recently, but v8 gives full a destructuring capability. Destructuring: What is it? It’s a way of plucking […]

apps script v8
Apps Script v8

JavaScript V8 Arrow functions, this and that

Function declarations versus arrow functions JavaScript V8 adds the arrow function declarator from modern JavaScript. This is a handy shorthand but it’s more than just that. There are some behavioral differences too that you’ll need […]

apps script v8
Apps Script v8

JavaScript V8 variable scopes

var, const and let One of the key things that V8 has sorted out is the scope of variables. Using var to declare variables meant that anything declared within the scope of a function could […]

apps script v8
Apps Script

Apps Script v8

Apps script now supports JavaScript ES6 Apps Script V8 now supports the same modern JavaScript you can use when writing for the browser. Up until now, you had to write in a dialect of JavaScript-based […]

No Picture
Apps Script & Java Script

Setting up blister lists

In Using blister custom functions I showed examples of how to lookup scriptDB lists as custom functions.  Here’s how to create lists. In each case, to access lists in your sheet you need to add a reference […]

No Picture
Apps Script & Java Script

Blister validation code

Here is the code for each of the example mentioned in GAS lists and validation. The custom functions You need this in your local workbook. You can find it in the examples sheet. These are the custom […]

No Picture
Apps Script & Java Script

Using blister custom functions

Examples Let’s take an example. Say you are a small garage, with a stock list of cars and you work exclusively with spreadsheets. You don’t want to take copies of the list, but you want […]

No Picture
Apps Script & Java Script

Blister custom functions

The custom functions These are the custom functions you can call directly from your sheets. The function documentation is here and you can find examples of use in Using blister custom functions and you’ll need the code described in Blister […]

No Picture
Apps Script & Java Script

GAS lists and validation

It’s very common to want to lookup some list, or apply them as validation to data entry when playing around with Spreadsheets. Between them, a search for Spreadsheet related VLOOKUP, INDEX and MATCH return 30 […]

Image
Apps Script & Java Script

Easy reference for published scripts

It would be useful to keep a reference guide to all projects and libraries shared on github, and their IDS. If you are using gasgit, then we already have everything needed to make that as […]

Image
Apps Script & Java Script

Measuring sheet operation performance

Looking into how various operations perform as the size of the sheet increase provided some interesting data. The objective is to see whether the time to execute particular operations is directly proportional to the size […]

Image
Apps Script & Java Script

Performance

All about performance analysis, tips and tricks for getting the best out of both Apps Script and Excel. […]

No Picture
Apps Script & Java Script

scriptDb JavaScript api examples

The JavaScript client is very similar to A VBA API for scriptDB, so reading that will give you a more detailed flavor of what can be done. The implementation is very different though, and there are […]

Image
Apps Script & Java Script

Testing the API

This is a ScriptDB API for JavaScript. The tests that are referred to in scriptDB API for JavaScript are implemented in https://storage.googleapis.com/toasty/t/gas/scriptdbapi.html. Code is below <!DOCTYPE html> <html> <head> <meta charset=”utf-8″ /> <title>scriptDB data input – ramblings.mcpher.com</title> <link […]

No Picture
Apps Script & Java Script

scriptdbcom implementation

Here is the javascript implementation for the scriptDB API. It needs jQuery. * methodType = “GET”; */ var dataType = “json”; if(!postData) { u += “&callback=?”; dataType = “jsonp”; } var d = $.Deferred(); var […]

Image
Apps Script & Java Script

Authenticating scriptDb JavaScript API

As per this blog post, Google Apps Script does not support CORS (cross origin resource sharing) to allow access from cross domain client apps. The API uses JSONP for GET requests to get over this, but […]

Image
Apps Script & Java Script

cParseCom implementation

I use scriptDB a lot , both with Google Apps Script and from other sources, including VBA, and in this blog post, I  compare parse.com performance with script DB. One of the things that Parse.com has going […]

Image
Apps Script & Java Script

Some simple examples

Because the GAS API is so similar to parse.com – nosql database for VBA, you may want to read that too, which has similar examples. Note that virtually all methods can be chained leading to pretty […]

Image
Apps Script & Java Script

creating Parse Classes from Google Spreadsheets

Just as in parse.com – nosql database for VBA, you’ll probably want to load up some test data from a Google Spreadsheet to a Parse.com class.  You’ll find some test data in this workbook – it’s same data […]

Image
Apps Script & Java Script

The Orchestration namespace

Take a moment to read these if this is a new topic for you. Orchestration of Apps Scripts – parallel threads and defeating quotas Jobs, work, stages, threads and chunks Namespaces and App structure Creating […]