Skip to content

Instantly share code, notes, and snippets.

View oshliaer's full-sized avatar
😼
Cat face with wry smile

Alex Ivanov oshliaer

😼
Cat face with wry smile
View GitHub Profile
function updateMenu_(menu, items) {
var menuIterator = makeIterator_(items);
while (true) {
menu.addItem(menuIterator.get().name, menuIterator.get().fn);
if (menuIterator.next().done) break;
};
}
function getScriptFunctionsAsMenuItems_(context) {
return Object.keys(context).filter(function (key) { return key.slice(-1) !== "_" && key !== "onOpen" && typeof this[key] === "function" }, context).map(function (item) {
@oshliaer
oshliaer / Code.gs
Created February 27, 2018 15:37
Default value of the cell of a Google Spreadsheet
function myFunction() {
var value = SpreadsheetApp.openById("ABC").getSheets()[0].getRange("A1").getValue();
Logger.log("value: %s" , value );
Logger.log("value == '': %s" , value == "" );
Logger.log("value === '': %s" , value === "" );
Logger.log("value === undefined: %s", value === undefined);
Logger.log("value === null: %s" , value === null );
Logger.log("!value: %s" , !value );
Logger.log("value === 0: %s" , value === 0 );
}

Google Drive MimeTypes are tied with static icons

Unsplash

Takes a row from another Sheet by the value of the index (when onEdit fires)

Unsplash

You can try this. Enter in the Spreadsheet in the range A:A a value from 1 to 16.

Google Apps Script Client Html Beep

Unsplash

@oshliaer
oshliaer / Code.gs
Last active January 10, 2020 03:44
function СПИСОКЛИСТОВ(separator, exceptions) {
var mutual = {};
mutual.exceptions = typeof exceptions === 'string' ? exceptions.split(',') :
exceptions;
mutual.res = [];
var list = SpreadsheetApp.getActiveSpreadsheet().getSheets().reduce(function(
p, c) {
var name = c.getName();