Skip to content

Instantly share code, notes, and snippets.

@JaKXz
JaKXz / Code.gs
Created June 14, 2017 07:35
Google Docs script to find the last active-ish row in a table
function onOpen() {
// get the proparties we need to work with
var doc = DocumentApp.getActiveDocument();
var body = doc.getBody();
var tables = body.getTables();
// find the last table [since there's more than one somehow]
var table = tables[tables.length - 1];
var rows = table.getNumRows();
{
"name": "nyc-ava-test",
"version": "1.0.0",
"description": "",
"main": "say.js",
"scripts": {
"test": "npm run test:node-tap && npm run test:ava && npm run test:node-tap:coverage && npm run test:ava:coverage",
"test:node-tap": "tap test-node-tap.js",
"test:ava": "ava test-ava.js",
"test:node-tap:coverage": "tap test-node-tap.js --coverage-report=text",