Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
FileDialog.OpenFileDialog
Shows dialog to select a file.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
FileDialog | 2.7 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ❌ No |
Parameters
none
Result
Returns "OK", "Cancel" or an error.
Description
Shows dialog to select a file.If dialog finishes well, you can query paths.
Examples
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")]
Loop
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"; "public.video" )]
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
- FileDialog.Reset
- FileDialog.SaveFileDialog
- FileDialog.SetCanSelectHiddenExtension
- FileDialog.SetFilter
- FileDialog.SetInitialDirectory
- FileDialog.SetMessage
- FileDialog.SetPrompt
- FileDialog.SetShowHidden
- FileDialog.SetTreatsFilePackagesAsDirectories
- FileDialog.SetWindowTitle
Release notes
- Version 9.4
- Added check to FileDialog.OpenFileDialog, FileDialog.SaveFileDialog, FileDialog.SelectFolderDialog and FileDialog.SelectItemDialog to ignore invalid initial directory for Mac.
- Version 8.3
- Upgraded FileDialog.OpenFileDialog, FileDialog.SelectFolderDialog and FileDialog.SaveFileDialog to use newer API on Windows to get newer dialog.
Example Databases
- CURL/Amazon S3/Amazon S3 Upload File
- CURL/Email/IMAP Email
- DynaPDF/Form/Form
- DynaPDF/PDF Library
- Files/FileDialogWatcher
- Mac and iOS/Machine Learning/Core ML Photos
- Mac only/Movies/AVAsset Export Session
- Win Only/Send Email via Email Application
- Win Only/Windows Player
- Win Only/WindowsML
Blog Entries
- Tips and tricks with MBS
- MBS FileMaker Plugin, version 9.4pr7
- MBS FileMaker Plugin, version 8.3pr1
- Open Dialog upgraded
- PDF Forms with MBS Plugin
- Comparing Base Elements Plugin to MBS FileMaker Plugin
FileMaker Magazin
This function checks for a license.
Created 18th August 2014, last changed 27th February 2017