Skip to main content

Show Alert Dialog (script step reference)

By March 1, 2025March 20th, 2025Online Help, Troi Dialog Plug-in
Troi Dialog Plug-in for FileMaker Pro

Show Alert Dialog

Displays an alert dialog with an optional informative text, from which the user can choose a button.

SyntaxScript step badge

Show Alert Dialog [ Select ; Result ; Message text ; Informative text ;
                    Button list ; Title; Custom icon; Switches ]

Options

Select entire contents replaces the entire contents of a field with the result. If not checked the result replaces the currently selected portion of the field
Result the button clicked
Message text the main message text of the alert
Informational text (optional) extra and longer text, displayed in a smaller font
Button list a return separated list of button labels
Title (optional) the title of the alert, shown at the title bar of the dialog
Custom icon (optional) container with the icon to show
Switches this determines the behavior of the dialog and which information is returned

Switches

You can also add one or more of these switches:

-IconAsBadge (macOS only) shows the warning icon (exclamation icon) with the custom icon as a small badge
-ReturnButtonText return the *text* of the button, instead of the number

Returned Result

Data type returned

Number

Result

The number of the button. By adding switches this function can also return the text of the button.

The plug-in can also return an error code. Returned error codes can be:

$$-50 paramErr parameter error

Originated in

Troi Dialog Plug-in 10.1

Compatibility

FileMaker Pro 17 to FileMaker Pro 21 (2024)

Considerations

If all buttons have an empty button text an OK button will be displayed.
On macOS 11 (Big Sur) and later the alert will be shown with a card-like user interface, with most content center aligned. Also note that in this case buttons can be shown vertically. If you specify a Cancel button it will be shown as the bottom most button, but the returned button numbers will stay the same as if the buttons were oriented from right to left.

This script step currently does not have an equivalent function.

Example

Show Alert Dialog [  $Result ; "We alert you to a small problem." ; 
                               "The internet is too big, please delete some of it now."; 
                               "OK" & "¶" & "Cancel" ;  "My Special Alert" ;   ;  ]

This will show a small alert dialog, with an informative text in a smaller font and two buttons.

Example 2

To show an alert with a custom icon create the following script:

Set Field [ gResult; "" // clear the result field first]

# Get the texts into variables:
Set Variable [ $MessageText ; "This is an alert dialog with this message text." ]
Set Variable [ $InformativeText ; "Here you can show extra info, in a smaller font." &
                                  "This can be a more elaborate explanation." ]
Set Variable [ $ButtonList ;   "OK" & "¶" & "Cancel" & "¶" & "3rd Button" & "¶" & "4th Button" ]
Set Variable [ $DialogTitle ;  "Troi Dialog Plug-in Special Alert" ]

# Get an icon from a (global) field:
Set Variable [ $CustomIcon ; gCustomIcon ]

# Now show the alert dialog:
Show Alert Dialog [ $Result ; Message: $MessageText ; Informative text: $InformativeText ; 
                              Button list: $ButtonList ; Title: $DialogTitle ; 
                              Custom Icon: $CustomIcon; Switches: "" ]

# Save the result into a field:
Set Field [ gResult; $Result ]

Exit Script [ Result: $Result ]

Used in example file

Dialog.fmp12

Related script stepScript step badge

Show Flash Dialog

Related functionsFunction badge

Dial_Dialog
Dial_FlashDialog

Related topics

Troi Dialog Plug-in online help (overview)


Online Help Page for Troi Dialog Plug-in for 17 to 2024 –> Show Alert Dialog (dialp7322) 2025-0320 16:41:16

troi.com
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognizing you when you return to our website and helping us to understand which sections of the website you find most interesting and useful.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.