I have one master sheet that handles a bunch of other spreadsheets, in the sense that the master has a whole bunch of importranges that pull specific info from the child ss's, the child ss's are identical in function, but not in data. Each of the child spreadsheets has their own automated scripts that pertain to each individual ss, but I want any script that affects every ss in an equivalent way to be run from one master sheet. All Child ss's have an identical structure, so the first sheet is named main, which pulls in a bunch of data from the other sheets on that same ss.
Basically, I need to run the exact same function on about 30 spreadsheets, and figured I could make 1 spreadsheet that had one script that would loop through the list of spreadsheets. Preferably, the list of spreadsheet ids is in plain text in a set of cells on the main spreadsheet (Lets say Main!B5:B), so that I could add a new spreadsheet id to the list, and any new spreadsheets that I add would also run the script when I run it.
function myFunction() {
// This next line is what I'm not sure how to do
// var ssList = [ Cell B5, Cell B6 ... ];
var len = ssList.length
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
var values = rows.getValues();
var rowsDeleted = 0;
// Spreadsheet loop
for (var i = 0; i < len; i++) {
var TargetSheet = SpreadsheetApp.openById(ssList[i]);
}
}