Alert ‹ Chocolat API, message, buttons)

Shows an alert.

  • title String – the title of your alert.
  • message String – the body of your alert message. Optional.
  • buttons Array – an array of buttons to display. Buttons are displayed from right to left.

Returns Number – the index of the button that was clicked. 0 is the right-most button. Optional.

Example"My Title", "My awesome body!", ["Yes", "No"]);


Play the system beep sound.


Show a user notification on 10.8. Notifications are ignored on 10.7.

  • options Object – an object of options to configure the notification. See example.


    title: "Acheivement Unlocked",
    subtitle: "Go To Hell",
    body: "Use the goto keyword 10 times in the same file",
    button: "Revert",
    callback: function () {
        // Do something when the "Revert" button is clicked