How can I get the OK button to be clicked when I use an alert or prompt?
SpreadsheetApp.getUi().alert("something goes here");
How can I get the OK button to be clicked when I use an alert or prompt?
SpreadsheetApp.getUi().alert("something goes here");
The alert prompt description has the exact method to do this.
I'm not going to copy and paste the sample provided, as I feel that's a bit of a waste.
You can use "alert(prompt, buttons)" or "alert(title, prompt, buttons)"
You can also use the "Enum ButtonSet" in this documentation.
However I don't think its possible that we can change it to recognize hitting the enter key as clicking "OK" button in Apps script .
Hope that helps!