function copyWithProtections(){
const sh = SpreadsheetApp.getActiveSpreadsheet();
const ss = sh.getSheetByName("#2");
const prot = ss.getProtections(SpreadsheetApp.ProtectionType.SHEET)
const sheetListArray = ["#3","#4","#5","#6","#7","#8","#9","#10","#11","#12","#13","#14","#15","#16","#17","#18","#19","#20","#21","#22","#23","#24","#25","#26","#27","#28","#29","#30","#31"]
for (let nSheet = 2; nSheet <= sheetListArray.length; nSheet++);
let p;
for (let i in prot) {
p = nSheet.getRange(prot[i].getRange().getA1Notation()).protect();
p.removeEditors(p.getEditors());
if (p.canDomainEdit()) {
p.setDomainEdit(false);
}
}
}
function renameSheets() {
let nSheet = ss.copyTo(sh).setName(sheetListArray[nSheet]);
}