var result = ui.prompt( 'Title', 'Message', ui.ButtonSet.OK_CANCEL); var button = result.getSelectedButton(); //What happens if the User clicks OK if (button == ui.Button.OK) {
var result = ui.prompt( 'Title', 'Message', ui.ButtonSet.SUBMIT_CANCEL); var button = result.getSelectedButton(); //What happens if the User clicks OK if (button == ui.Button.SUBMIT) {
To override the default "OK" button, pass a value from theUi.ButtonSet
enum as thebuttons
argument.
Property | Type | Description |
---|---|---|
OK | Enum | A single "OK" button, indicating an informational message that can only be dismissed. |
OK_CANCEL | Enum | An "OK" button and a "Cancel" button, allowing the user to either proceed with or halt an operation. |
YES_NO | Enum | A "Yes" button and a "No" button, allowing the user to answer a yes/no question. |
YES_NO_CANCEL | Enum | A "Yes" button, a "No" button, and a "Cancel" button, allowing the user to either answer a yes/no question or halt an operation. |
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-script-community.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/af9960c9-d333-4d1b-adf1-2b948ae36f3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Come and listen to a recap of G Suite sessions from #GoogleNext19 with @CinFourThirds and myself, hosted by the venerable @mhawksey! 👇 https://t.co/q67MaCmihN
— Ben Collins (@benlcollins) April 19, 2019