# Youseful Software - FileMaker sample script
# Script name: Youseful - Action menu
# Plug-in: YsflUI.fmx64 (Windows x64)
# Setup: Run in interactive FileMaker Pro on Windows. No fields needed. Menu actions only display demonstration messages.
# Expected: Preview displays Preview selected. Export displays Export selected. Escape dismisses the menu. Delete is disabled.
# Format: UTF-8 Script Workspace step listing. Add the steps manually; this is not an importable FileMaker file.
# Lines beginning with # are notes; optionally add them as Comment steps.
# Preserve calculation quotes, backslashes, and paragraph symbols exactly.

Set Variable [ $choice ; Value: YsflUi_MenuShow (
    "Preview|preview¶Export|export¶-¶Delete|delete|disabled"
) ]
Set Variable [ $error ; Value: YsflUi_LastError ]
If [ $error <> 0 ]
    Show Custom Dialog [ "Menu failed" ; YsflUi_LastErrorText ]
    Exit Script [ Text Result: $choice ]
End If
If [ IsEmpty ( $choice ) ]
    Exit Script [ Text Result: "Dismissed" ]
Else If [ $choice = "preview" ]
    Show Custom Dialog [ "Action" ; "Preview selected" ]
Else If [ $choice = "export" ]
    Show Custom Dialog [ "Action" ; "Export selected" ]
End If
