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 […]
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 […]
Anaylze and colorize the sentiment of inidivual sentences in Google using Documents Google Language API […]
Apps Script/JavaScript library to generate prettified HTML Markup from JSON […]
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 […]
How to make getting JavaScript code in the right order less of a chore, and detect object property typos before they become a problem. […]
Accidentally accessing non-existent properties and tracking down where that is happening is a big time waster that a JavaScript proxy can help you track down. In Fix Apps Script file order problems with Exports I […]
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 […]
Why unit testing? There are many test packages for Node (my favorite is ava) and there are also a few for Apps Script but I couldn’t find one that was exactly what I was after, […]
This article is a little more advanced than usual, and we’ll cover a number topics in one go. A JavaScript proxy gives us the ability to intercept JavaScript as it attempts to access the properties […]
Snippet background This is a very short snippet with a hack for dealing with when a user actions a verification email from Firebase. The example is from a webapp client, but it applies to a […]
If you’ve been using Apps Script for a while, since back when it was running on the Rhino JavaScript emulator; see (What JavaScript engine is Apps Script running on?), you’ll remember the Execution Transcript. This […]
javaWhen I first read about Symbols coming to JavaScript, I couldn’t figure out what the point was or even what they were, so I just kind of parked it. Lately I’ve been doing some work […]
The usual way to access files and folders on Drive from Apps Script is via their ID, yet on other platforms we’re more used to using file and folder paths. This can be a bit […]
Let’s say you need to find out how your function was called, either for in app debugging or some other purpose. A JavaScript Error has a non standard property (stack) that contains some info about […]
Today’s snippet is going to be shorter than usual, because there’s a really easy solution. Many objects have a default method like toString(). You may want to add one of those to your own functions […]
In Enrich your developer profile on scrviz I showed how scrviz could be used to show off your Apps Script work to potential clients (Showcase your Apps Script work and get hired via vizzy) and how to […]
Motivation for apps script example I originally create both qottle and rottler for various node projects, but realized that I had some Apps Script that could be solved with them too. One of them was […]
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. […]
rottler – a rate limit helper Working with rate limits can be hard, so the purpose of rottler is to provide no only a way of testing rate limit strategy, but also an helper to […]
Vuex If you use Vue.js, then you probably use (or should consider using) Vuex for state management. Like most Vue.js related things, it’s at its easiest when used with Node tooling, but you can also […]
Include patterns When using HtmlService it can be quite messy to organize your script/js/html/css files and vue components so that they can be inserted into your add-on/webapp. This becomes much more complex when you want […]
When a browser tab goes in and out of view, it’s possible you want to do something differently. If you’re writing Apps Script add-ons this is especially true. TabVisibility is a class to allow […]
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. […]
Create beautiful Apps Script add-ons with Vuetify and Vue.js The idea of ‘reactive programming’ has been around for many years, but frameworks such as React, Vue and so on have moved it into the mainstream. […]
TimeSimmer When creating simulations, and especially when testing or demoing apps that simulate events over time, you often need to speed up or slow down time. You may even need to slow it up or […]
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 […]
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 […]
Qottle If you are using an API you often need to queue tasks that are asynchronous and constrained by other factors such as rate limits of the API. Qottle is a general purpose queue manager […]
This article looks at how to extend classes and apply that easily handling data structures presented as an array of bytes as you’d have to do when dealing with binary data from a file. […]
Many things in Vuetify and Vuejs are hard to come to grips with, but for me, none more so that the very odd property v-on and its relationship to v-slot:activator Two things that helped me see […]
What is Apps Script It’s the language used for extending GSuite and is based on JavaScript. Unlike the JavaScript that runs in your browser, it runs on a Google Server in the cloud, but unlike […]
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 […]
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 […]
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 […]
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 […]
In Integrating VBA and Javascript I showed how you could run your JavaScript and Apps Script source locally on your PC from VBA. In this example, we’ll use that capability for comparative unit testing. Again […]
In Integrating VBA and Javascript I showed how you could run your JavaScript and Apps Script source locally from VBA. Let’s take a look at how they perform. Recap You’ll recall that we can pull […]
In Integrating VBA and Javascript I showed how you could run your JavaScript and Apps Script source locally on your PC from VBA. The example in Local VBA versus JavaScript performance used apps script code […]
When you click on an infobox, use a quicklink or select a category on a generated map the zoom level will change (if you have enabled it in your excel parameters.). Click on an infobox or use a quicklink Here […]
What is the infoBox An infoBox is an enhanced infoWindow. Details can be found here . I will be converting the Google Maps modules on this site to use the infoBox rather than the native Google Maps […]
javaScript: Flying around and asynchronicity in google Earth This relates to Data Driven Mapping applications and the Javascript HowTo section Google Earth Api You will find tons of content on Google Earth , most of which is described […]
javaScript:creating google visualization DataTables This relates to Data Driven Mapping applications and the Javascript HowTo section Google Visualization Tables I have covered Google Visualization in various forms with an ‘Excel slant’ on this site. Let’s take a look […]
VizMap: the data javaScript This relates to Data Driven Mapping applications For this example I had created a Concerts/Venues example that is now deprecated. The complete workbook (googlemapping.xlsm) can be downloaded (above) and the example Parameter WorkSheet is […]
If you have a business account for Google Mapping, you’ll need to provide your client id and crypto key. These things are meant to be kept private, so I did not provide a mechanism for […]
Plotting markers on on a Google Earth This article will cover how to create a basic KML file so that your Excel data can be mapped on Google Earth. There is a more advanced implementation […]
JavaScript currying and functional programming was an introduction to currying. A very useful technique that uses the properties of JavaScript closures – how, where and why to encapsulate argument values to create a new version […]
In Abstracting services with closures I showed how you could get more functional by using closures. Curried functions are another approach to encapsulating values in a function – minimizing the number of arguments and variables […]
Given a start point, a distance and a heading, it is possible to work out the resulting latitude and longitude. See the maths behind it here. See Radians Versus Degrees for the utility functions we […]
javaScript: Click events in Google Earth This relates to Data Driven Mapping applications and the Javascript HowTo section Events in Google Earth I deal with event handling in Google earth in Using Google Earth but dealing […]
javaScript: creating google visualization charts and tables This relates to Data Driven Mapping applications and the Javascript HowTo section Google Visualization tables and charts All visualizations are created from the dataViews mentioned in Using Google Visualization DataViews. Once […]
javaScript: creating tabbed content This relates to Data Driven Mapping applications and the javaScript ‘howTo’ section. For this example I had created a Concerts/Venues example that is now deprecated. The complete workbook (googlemapping.xlsm) can be downloaded (above) and […]
VizMap: the element parameter Block This relates to Data Driven Mapping applications This parameter block is handled by cDataSet classes and defines the dictionary fields required for each tab on a markers infoWindow and how to handle their […]
Deprecated Google has now stopped its Earth API and Maps API is a paid for API nowadays. Some capabilities have also been either removed or changed. Therefore, I had to remove all examples of VizMap […]
Tailoring the look of your VizMap application Info Window look and feel There are a number of things you can tailor to change the behavior and look of your generated application. VizMap Element positioning allows you […]
Overlaying polyLines to make flight paths on google markers This article will cover how to add flight paths to Google Maps. For a quickstart, see Step by Step Guides Try it out first ? If you […]
Navigating using quicklinks and categories Try it out first ? For a summary step by step explanation see How to add quickLinks to a Map If you just want a to try it, then you can […]
functions are Objects too. As I mentioned in Learning javaScript every variable in js is an object. A javaScript function is also an object. This means it can be assigned to a variable. consider this.. function x() […]
Creating and working with classes in VBA is very different from working with js classes. In fact, JavaScript is a classless language – there is no such thing as a class. This is not so […]
Google apps script is javaScript, with the addition of a set of classes which allow access to Google apps capabilities such as spreadsheet data structures and so on. This means that to be able write […]
Put addresses on a map as markers We’ve already looked at how to geoCode addresses using various APIs and how to create maps with Google Maps from Excel data. Now let’s look at using Bing Maps to put […]
Put addresses on a map as markers We’ve already looked at how to geoCode addresses using various APIs and how to create maps with Google Maps from Excel data. Now let’s look at using Bing Maps to put […]
Put addresses on a map as markers We’ve already looked at how to geoCode addresses using various APIs and how to create maps with Google Maps from Excel data. Now let’s look at using Yahoo Maps to put […]
We’ve already looked at how to geoCode addresses using various APIs. Now lets look at using Google Maps to put markers on a Map using an Excel worksheet as input. As usual you can find the […]
GeoCode Excel Data with Bing Maps If you haven’t read about Bing rules on doing this, please do. Since we have done this in Google Maps, I thought it would be worthwhile to see how it’s done […]
javaScript: Twitter API integration with google Earth and maps This relates to Data Driven Mapping applications and the Javascript HowTo section Twitter API Using the Twitter RESTful API, it is very straightforward to add relevant tweets to […]
There is plenty of reference information cJobject on this site, starting with How to use cJobject, or just enter cJobject in the search box. Here’s a quick reminder of what you’ll need to understand to follow […]
By the time that A gigantic pub crawl gets here, then various components will have suggested pubs inside an area and declared pub crawls. We can use the Maps API to work out the optimal route between […]
Geocode Excel Data with Yahoo Placemaker If you haven’t read about Yahoo rules on doing this, please do. Since we have done this in Google Maps, and in Bing Maps, I thought it would be worthwhile to see […]
Why would you need to ? Perhaps for layout, you may want to place text where it will fit, or change the font size if it doesn’t. On example I came across was using when […]
Promises are an elegant way of providing for the handling of the future completion of an action in JavaScript. You will be familiar with the concept of a callback. This allows your app to get […]
You probably read the announcement that Parse.com is closing its hosting service. This is probably a good time to look at firebase, but if you are using my dbabstraction library, you can change to some other backend […]
There’s no getting away from the fact that Apps Script is slower than the equivalent client based JavaScript processing. It is fundamentally synchronous in implementation, and also has limits on processing time and a host […]
There are many rates and quotas in the Google Apps Script environment. One of the usual ways of dealing with it is to sleep between instructions, but that seems to be a rather blunt instrument. […]
‘m showing score reports for the BigQuiz app. This is an individual players score compared to the maximum he could have got as well as the number of questions that were correctly answered, and also comparing […]
If you’ve been trying out the Configurable circular timer with D3 or playing around with Example of clock using d3 configurable timer you’ll have seen how easy it is to create a versatile timer by just configuring a few […]
In Configurable circular timer with D3 I showed a circular timer made with D3.js . Although it’s not really what it’s for, this simple example shows how to make a complex viz. This is a clock […]
I don’t use jQuery, neither in regular webapps nor in Apps Script HtmlService apps. No particular reason – I just prefer to use vanilla JavaScript. I often use d3.js, mainly for visualization as in these examples elsewhere […]
Normally when you write code for apps that have a server and client component, you write the code for one or the other. The client javascript code goes in an html file (usually called something […]
This is a webapp that touches on a number of different Apps Script capabilities such as.. The app structure OAuth2, and multiple providers and roles Firebase authentication Firebase to manage player data Using libraries to […]
In this section, we’ll build an application that pulls together many concepts already covered elsewhere on this site. You can run it standalone at xliberation.com, or below, embedded in this page The target application Pulling together Playing […]
Overlaying shapes on markers Try it out first ? If you just want a to try it, then you can download an example application (googleMapping.xlsm) and come back here later. First you should take a look at Adding markers […]
This is an interesting d3.js and parse.com mashup of a number of topics covered on this site. The target is to build an app that Retrieves color scheme data from a parse.com database, much like […]
VizMap: the generated javaScript This relates to Data Driven Mapping applications For this example I had created a Concerts/Venues example that is now deprecated. The complete workbook (googlemapping.xlsm) can be downloaded (above) and the example Parameter WorkSheet is […]
javaScript: Flying around and asynchronicity in google Earth This relates to Data Driven Mapping applications and the Javascript HowTo section Google Maps Api You will find tons of content on Google Maps, most of which is described […]
Deprecated Google has now stopped its Earth API and Maps API is a paid for API nowadays. Some capabilities have also been either removed or changed. Therefore, I had to remove all examples of VizMap […]
There’s a lot of stuff on this site about both JavaScript and VBA. In addition to all the JavaScript that people are generating for Apps Script, there are millions of libraries and useful pieces of […]
GeoCode addresses with Google Maps API If you haven’t read about Bing rules on doing this, please do. In this section, we will look at what Google responds to a request for an address geoMapping. Using […]
One of the most powerful features of Apps Script is the HTML service. This allows you to create html/JavaScript applications which can be served up as webapps, run in sidebars or as add-ons and created great […]
Apps Script is inherently synchronous – you cant do lots of things at once. Primarily to get round the execution limit, I did a science project using triggers for parallel processing but the triggers are fairly unpredictable […]
If you already write Apps Script add-ons, you’ll know that debugging can be a little challenging, and although you can use the developer tools in chrome on a running add-on, breakpoints don’t persist between sessions […]
What can you learn here? scriptcontrol object call from VBA use javaScript The ScriptControl Object This object gives you access to a scripting engine that will accept scripting in both javaScript and VBScript. Since this site has […]
In Flight Data from Fusion I introduced integration between Google Fusion and D3.js. This next version fixes up a few issues to do with Google Fusion API quotas and limits (see exponential backoff and jquery promises), and […]
bruce mcpherson is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Based on a work at http://www.mcpher.com. Permissions beyond the scope of this license may be available at code use guidelines