....instead of it's actual name. My function involves lines like var ss = SpreadsheetApp.getActive().getSheetByName('Responses');
I found some code & amended it to show what was happening.
function SheetNames() {
var ss = SpreadsheetApp.getActive();
var allsheets = ss.getSheets();
SpreadsheetApp.getUi().alert(allsheets);
//shows sheet sheet sheet sheet
for (var s in allsheets){
var sheet=allsheets[s] //Use Subject instead of sheet here?
// & exit loop if sheet = Reponses
//your code here ...
var ss = SpreadsheetApp.getActive().getSheetByName(s);
ss.activate();//doesn't recognise s as a sheet
SpreadsheetApp.getUi().alert(s);
//shows 0 1 2 3 4, but which is which?
}//end of sheets loop.
}// end of function