Apps Script duplicate functions