UserGuide

IDE Scripting Notification Commands

From Xojo Documentation

The Notification commands are used to get the user’s attention by displaying a message or making a sound.

Beep

The Beep command plays the system beep sound.

Sample Code

Beep

Print(text As String)

Displays the specified text in a simple dialog box with an OK button.

Sample Code

Display "hello":

Print("Hello")

ShowDialog(Message As String, Explanation As String, DefaultButtonCaption As String, CancelButtonCaption As String, AltButtonCaption As String, Icon As Integer) As String

The ShowDialog command displays a dialog box on the screen. You can specify the message and determine the buttons and their text.

Notes

If you pass in an empty string to CancelButtonCaption or AltButtonCaption, then the button does not appear. Returns a String containing the caption of the button that was pressed.

Values for Icon are:

  • -1: No icon
  • 0: Note icon (App Icon on Mac)
  • 1: Caution icon (On Mac, App Icon is superimposed)
  • 2: Stop Icon (App Icon on Mac)
  • 3: Question Icon (App Icon on Mac)

Sample Code

Display a simple dialog:

Dim result As String
result = ShowDialog("Hello!", _
"Is it me you're looking for?", _
"Yes", "No", "", 1)

ShowURL(url As String)

Displays the URL in the default web browser.

Sample Code

ShowURL("http://www.xojo.com")

Speak(text As String)

The Speak command speaks the supplied text.

Sample Code

Say "hello":

Speak("Hello")