I need a way of running a custom script more than 20 times in my spreadsheet.  I'm creating a class assessment spreadsheet that will be used as a master across my school, and it needs to retrieve the names of the students in each class.  Each student's name is a sheet name in the spreadsheet.  These are retrieved by numerical reference to the sheet they are on (i.e. =getsheetname(2) returns 'John Smith' for the spreadsheet for class 2B, but 'Sarah Jones' for class 5A's spreadsheet).However I keep getting: error: too many simultaneous invocations: Spreadsheets (line20, file Code)This is the code:function getSheetName1(index) {   var ss = SpreadsheetApp.getActiveSpreadsheet();   var allSheets = ss.getSheets();   var allSheetNames = new Array();   var SheetNumber = allSheets.length;   if (arguments.length == 0) {     return SpreadsheetApp.getActiveSheet().getName();  } else {     for (var i = 0; i < SheetNumber; i++) {       allSheetNames[i] = allSheets[i].getName();    }     if (index == 0) {       return allSheetNames;     } else {       return allSheetNames[index-1];    }  }}I understand this is because I can only run the custom script 20 times, but there are 30 students in each class.  Is there a way to circumvent this? I have only a basic understanding of code so your patience would be appreciated!
Run a custom script more than 20 times in Google Spreadsheet
google spreadsheets;google apps script