Google docs – Access text changes realtime

If a browser plugin is an appropriate way to deliver the feature, it should be possible to listen to changes that Google Docs makes to the DOM when it updates the page content. // This div contains all of the page content and not much else, in my rudimentary testing. var pageRoot = document.getElementsByClassName(‘kix-appview-editor’)[0].firstChild; var … Read more

Changing background color of specific cell on Google sheet

You can use setBackground property with getRange. Try the below snippet. function myColorFunction() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var range = ss.getSheetByName(“Form Responses 1”).getRange(2,6,ss.getLastRow()); var cellRange = range.getValues(); for(i = 0; i<cellRange.length-1; i++){ if(cellRange[i][0] == “Open”) { ss.getSheetByName(“Form Responses 1”).getRange(i+2,6).setBackground(“red”); ss.getSheetByName(“Form Responses 1”).getRange(i+2,6).setFontColor(‘white’); } } }

How to enable autocomplete for Google Apps Script in locally-installed IDE

I found the solution that partially works, but it may not be applicable to other software. The steps below are for Visual Studio Code: Install the NPM package containing type definitions for GAS using https://www.npmjs.com/package/@types/google-apps-script In your locally-saved script, create a ‘.js’ file and type import ‘google-apps-script’;

Trying to read cell 1,1 in spreadsheet using Google Script API

You have to first obtain the Range object. Also, getCell() will not return the value of the cell but instead will return a Range object of the cell. So, use something on the lines of function email() { // Opens SS by its ID var ss = SpreadsheetApp.openById(“0AgJjDgtUl5KddE5rR01NSFcxYTRnUHBCQ0stTXNMenc”); // Get the name of this SS … Read more

How to convert Time into decimal float in Google Sheets using Script?

Google Sheets In Google Sheets, if you have a date/time value in a cell (e.g. “D9”), then use =HOUR(D9)+(MINUTE(D9)/60). If the value is stored in the format 04:29, then use =INDEX(SPLIT(D9, “:”), 1) + (INDEX(SPLIT(D9, “:”), 2)/60). Google Sheets API & Google Apps Script If you want to use the Google Sheets API or Google … Read more

Import JSON data into Google Sheets

JSON.parse For those who are seeing this in 2011+, as pointed out by Henrique Abreu at the Google support forum, Utilities.jsonParse is/will be deprecated. As you can see from the thread, there’s a bug with this function that it does not work when your keys are numbers, ie “1234”. As suggested, you should be using … Read more