Skip to content

Instantly share code, notes, and snippets.

@oshliaer
Last active January 10, 2020 03:44
Show Gist options
  • Save oshliaer/410e56452a02f6ae7ded429c48bfa224 to your computer and use it in GitHub Desktop.
Save oshliaer/410e56452a02f6ae7ded429c48bfa224 to your computer and use it in GitHub Desktop.
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();
if (!~p.exceptions.indexOf(name)) {
p.res.push(name);
}
return p;
}, mutual);
if (!separator)
return list.res;
return '\'' + list.res.join('\'!' + separator + ';\'') + '\'!' + separator;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment