Skip to content

Instantly share code, notes, and snippets.

View rudimusmaximus's full-sized avatar

raul flores jr rudimusmaximus

View GitHub Profile
@rudimusmaximus
rudimusmaximus / a Google Apps Script Getting Started Guide.md
Last active February 11, 2020 16:51
Getting started in google apps script

How To Get Started In Google Apps Script

Initially intended to extend G Suite apps, I like to think of Google Apps Script as a gateway to more kinds of development. Think of it as workflow glue and the power of programming that can interract with Google Apps and external APIs too!

Purpose

Provide a living document for whenever someone asks, " so, how do i get started with Google Apps Script?".

Working Outline

Just the orgainizing principles and some key links.

1 Starting point: Good Things to Keep in Mind

Scripts are 'bound' to a container like sheets, docs, slides or forms. These can be accessed from the containing doc and opened say in sheets by going to the menu Tools > Script editor. Scripts can also be standalone for addons or web apps. Your script home page is a dashboard found here script.google.com. The help link there will get you to an explanation of the dashboard.

@rudimusmaximus
rudimusmaximus / bookendWithToast.gs
Last active April 7, 2018 18:28
In Google Apps script (for a sheet), use "bookend toast" messages to cleanly communicate with user when script has executed first and last line
/**
* Example use of a single pair of toast messages
*/
function doSomethingExample() {
//toast(msg, title, timeoutSeconds)
SpreadsheetApp.getActive().toast("Working...", "Doing x", 30);//message 1 longer than you need
Utilities.sleep(8000); //8 seconds simulating work
SpreadsheetApp.getActive().toast("Finished!","OK", 2);//message 2 interrupts message 1
@rudimusmaximus
rudimusmaximus / Four Level NAME$PACE Example for google apps script
Last active January 21, 2018 09:56
Completed example .gs to demonstrate 4 level namespacing
/****
* 'SEED' THE NAMESPACES
*****/
var NAME$PACE1 = (function(ns) {
ns.author = "Raul Flores, Jr";
ns.description = "This is an example 4 level namespace."
ns.value = "some value";
ns.Enums = {
ZERO: 0,
ONE: 1,
@rudimusmaximus
rudimusmaximus / queryASpreadsheet.gs
Last active February 9, 2025 15:40
Follow up to Totally UnScripted Episode 3: SQL like queries in Google Apps Script
/**
* quickly test our function
*/
function test(){
var result = queryASpreadsheet('1sPevvtTMSd9LUptX8qdsw4VJf07nOal_1qn9JLwO4fQ',
'Example Data',
'A1:C',
'SELECT A,B,C WHERE B < 7');
var rows = result.length;//7