I need to have a centralized script which is executed by many different sheets. I did some research here and figured out how to do it by using the library method:
test.Submit();
Where "test" is the library identifier, and Submit() is the function within the library.
I have the issue that Submit() is trying to get the active spreadsheet (the "client" sheet from where the function is called):
function Submit() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName('Sheet1');
sheet.getRange(1,1).setValue("OK!"); }
It seems that getActiveSpreadsheet() does not work (ss is Undefined)
How can I let the main function Submit() know which spreadsheet needs to be edited?