YOUSEFUL / FILEMAKER

Youseful Dialog: FAQ, examples and tutorial

Learning center · Function reference

Use YsflDialog.fmx64 for Windows dialogs, forms, lists, progress windows and toasts. Run these examples from scripts in an interactive FileMaker Pro session.

FAQ

What do button results mean? Buttons are numbered from 1. Escape, closing the window, or the designated cancel=N button returns 0; timeout returns -1. Do not treat every nonzero result as an affirmative answer.

How are input values returned? Input returns a paragraph list: button result, then one value per field. Use GetValue to read each item. Check the button result before using the values; cancellation is not acceptance.

How do I define fields? Each line is label|type|initial|choices. A simple text field can be Name|text|. See the reference for passwords, checkboxes, dropdowns and multiline input.

Does a progress window cancel my loop? No. Poll ProgressState, stop your own work on cancelled, and call ProgressClose on every completion path.

Examples

Ask before proceeding:

filemaker
YsflDl_Message ( "Continue?" ; "Run the sample task?" ; "Continue¶Cancel" ; "cancel=2 icon=question" )

Continue returns 1; Cancel or Escape returns 0.

Show a three-second notification:

filemaker
YsflDl_Toast ( "Sample task finished" ; 3000 ; "corner=bottomright" )

The notice dismisses itself. This does not block like a modal message.

Tutorial

Standalone sample scripts: Ask for a name.

Goal: collect a display name and respect cancellation.

  1. Create a script named Youseful - Ask for a name.
  2. Add these steps:
filemaker
Set Variable [ $reply ; Value: YsflDl_Input (
    "Your name" ; "Enter a display name for this example." ;
    "Name|text|" ; "Save¶Cancel" ; "cancel=2 focus=1"
) ]
Set Variable [ $error ; Value: YsflDl_LastError ]
If [ $error <> 0 ]
    Show Custom Dialog [ "Dialog failed" ; YsflDl_LastErrorText ]
    Exit Script [ Text Result: $reply ]
End If
Set Variable [ $button ; Value: GetAsNumber ( GetValue ( $reply ; 1 ) ) ]
If [ $button <> 1 ]
    Exit Script [ Text Result: "Cancelled" ]
End If
Set Variable [ $name ; Value: Trim ( GetValue ( $reply ; 2 ) ) ]
If [ IsEmpty ( $name ) ]
    Show Custom Dialog [ "Name needed" ; "Run the example again and enter a name." ]
    Exit Script [ Text Result: "No name" ]
End If
Show Custom Dialog [ "Welcome" ; "Hello, " & $name ]
  1. Enter Alex and choose Save. Expected: Hello, Alex.
  2. Run it again and choose Cancel. No welcome dialog should appear.

Troubleshooting

Use cancel=2 only when the second button is the intended cancel action. Input uses a compact delimiter format; do not insert unescaped user-defined labels containing pipes or paragraphs into the field definition. Modal windows wait for the user, so do not invoke these examples from unattended server work.