I need to be able to disable the OK button in Google Scripts until the User has input text into the prompt. Is there a way to do this?
Have tried to use the following code but it just aborts the process.
var ui = SpreadsheetApp.getUi();
var examinerName = ui.prompt('Random Text.', ui.ButtonSet.OK_CANCEL);
// Process the user's response.
if (examinerName !== "" && ui.Button.OK) {
ui.alert('Process Aborted'); // Aborts the process and stops the script showing an alert.
return false;
} else (examinerName === "" && ui.Button.OK); {
Logger.log('The user\'s name is %s.', examinerName.getResponseText());
}
I would like it to wait until there is some text and then complete the script