Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.0   6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3    Statistic  


Shows dialog to select a file.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
FileDialog 2.7 Yes Yes No No No

MBS( "FileDialog.OpenFileDialog" )




Returns "OK", "Cancel" or an error.


Shows dialog to select a file.
If dialog finishes well, you can query paths.


Run Open Dialog:

Delete All Records [No dialog]
Set Variable [$r; Value:MBS("FileDialog.Reset")]
Set Variable [$r; Value:MBS("FileDialog.SetShowHidden"; FileDialog::ShowHidden)]
Set Variable [$r; Value:MBS("FileDialog.SetAllowMulti"; FileDialog::AllowMulti)]
Set Variable [$r; Value:MBS("FileDialog.SetResolvesAliases"; FileDialog::ResolvesAliases)]
Set Variable [$r; Value:MBS("FileDialog.SetTreatsFilePackagesAsDirectories"; FileDialog::TreatsFilePackagesAsDirectories)]
Set Variable [$r; Value:MBS("FileDialog.SetCanSelectHiddenExtension"; FileDialog::CanSelectHiddenExtension)]
Set Variable [$r; Value:MBS("FileDialog.SetWindowTitle"; FileDialog::WindowTitle)]
Set Variable [$r; Value:MBS("FileDialog.SetInitialDirectory"; FileDialog::InitialDirectory)]
Set Variable [$r; Value:MBS("FileDialog.SetNameFieldLabel"; FileDialog::NameFieldLabel)]
Set Variable [$r; Value:MBS("FileDialog.SetPrompt"; FileDialog::Prompt)]
Set Variable [$r; Value:MBS("FileDialog.SetMessage"; FileDialog::Message)]
Set Variable [$r; Value:MBS("FileDialog.SetNameFieldStringValue"; FileDialog::NameFieldStringValue)]
Set Variable [$r; Value:MBS("FileDialog.OpenFileDialog")]
If [$r = "OK"]
    Set Variable [$index; Value:0]
    Set Variable [$count; Value:MBS("FileDialog.GetPathCount")]
        New Record/Request
        Set Field [FileDialog::Path; MBS("FileDialog.GetPath"; $index)]
        Commit Records/Requests []
        Set Variable [$index; Value:$index + 1]
        Exit Loop If [$index = $count]
    End Loop
End If

Select a video file:

Set Variable [$r; Value:MBS("FileDialog.Reset")]
Set Variable [$r; Value:MBS("FileDialog.SetMessage"; "Please select video:")]
Set Variable [$r; Value:MBS( "FileDialog.SetFilter"; "" )]
Set Variable [$r; Value:MBS("FileDialog.OpenFileDialog")]
If [$r = "OK"]
    Set Field [AVAsset Export Session::Input File Path; MBS("FileDialog.GetPath"; 0)]
End If

See also

Example Databases

FileDialog.GetWindowTitle   -   FileDialog.Reset

Feedback: Report problem or ask question.

MBS Xojo Plugins