Okay, I've been a coding for a little while and have had the chance to do a number of things.
One issue I'd like to find a more elegant way is running scripts based on the value of a variable.
At the moment I'm doing it like this.
if (ScriptName == 'overnightRun' ) {
overnightRun();
}
if (ScriptName == 'resetAnalysisSheets' ) {
resetAnalysisSheets();
}
if (ScriptName == 'resetActiveSheetFormulae' ) {
resetActiveSheetFormulae();
}
if (ScriptName == 'saveRemainingContractSheets' ) {
saveRemainingContractSheets();
}
if (ScriptName == 'saveAllContractSheets' ) {
saveAllContractSheets();
}
if (ScriptName == 'saveCurrentContractSheet' ) {
saveCurrentContractSheet();
}
if (ScriptName == 'clearDataSheets' ) {
clearDataSheets();
}
Surely there must be a better way. Something more like this.
run.script(ScriptName);
Anyone any ideas? Thanks for reading!