| Components | All | New | MacOS | Windows | Linux | iOS | ||||
| Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old | |
FileDialog.GetPath
Queries the native path with the given index.
| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
| FileDialog | 2.7 | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ❌ No |
MBS( "FileDialog.GetPath" { ; Index } ) More
Parameters
| Parameter | Description | Example | Flags |
|---|---|---|---|
| Index | The index of the path. | 0 | Optional |
Result
Returns native path.
Description
Queries the native path with the given index.Use Path.NativePathToFileMakerPath to convert to a FileMaker path if required.
Please note that in sheet mode (FileDialog.SetUseSheet with 1), you need to wait for the trigger to be called before you can query paths.
Examples
Export all containers to one folder:
#Ask for folder?
Set Variable [$r; Value:MBS("FileDialog.Reset")]
Set Variable [$r; Value:MBS("FileDialog.SetMessage"; "Export folder?")]
Set Variable [$r; Value:MBS("FileDialog.SelectFolderDialog")]
If [$r = "OK"]
#get path from dialog:
Set Variable [$npath; Value:MBS( "FileDialog.GetPath"; 0 )]
#convert to FileMaker path for Export Field Contents
Set Variable [$fpath; Value:MBS( "Path.NativePathToFileMakerPath"; $npath )]
#Loop over all records:
Go to Record/Request/Page [First]
Loop
#Export files from this record
#figure out file name
Set Variable [$name; Value:GetAsText ( Container Batch Export::Test1 )]
Set Variable [$name; Value:GetValue($name; 1)]
Set Variable [$name; Value:MBS( "Path.LastPathComponent"; $name )]
Set Variable [$dpath; Value:MBS( "Path.AddPathComponent"; $fpath; $name )]
Export Field Contents [Container Batch Export::Test1; “$dpath”]
#Next record
Go to Record/Request/Page [Next; Exit after last]
End Loop
End If
Set Variable [$r; Value:MBS("FileDialog.Reset")]
Set Variable [$r; Value:MBS("FileDialog.SetMessage"; "Export folder?")]
Set Variable [$r; Value:MBS("FileDialog.SelectFolderDialog")]
If [$r = "OK"]
#get path from dialog:
Set Variable [$npath; Value:MBS( "FileDialog.GetPath"; 0 )]
#convert to FileMaker path for Export Field Contents
Set Variable [$fpath; Value:MBS( "Path.NativePathToFileMakerPath"; $npath )]
#Loop over all records:
Go to Record/Request/Page [First]
Loop
#Export files from this record
#figure out file name
Set Variable [$name; Value:GetAsText ( Container Batch Export::Test1 )]
Set Variable [$name; Value:GetValue($name; 1)]
Set Variable [$name; Value:MBS( "Path.LastPathComponent"; $name )]
Set Variable [$dpath; Value:MBS( "Path.AddPathComponent"; $fpath; $name )]
Export Field Contents [Container Batch Export::Test1; “$dpath”]
#Next record
Go to Record/Request/Page [Next; Exit after last]
End Loop
End If
Select folder in one expression:
Let([
r = MBS("FileDialog.Reset");
r = MBS("FileDialog.SelectFolderDialog");
folder = If ( r = "OK" ; MBS("FileDialog.GetPath"; 0); "" )
]; folder)
r = MBS("FileDialog.Reset");
r = MBS("FileDialog.SelectFolderDialog");
folder = If ( r = "OK" ; MBS("FileDialog.GetPath"; 0); "" )
]; folder)
See also
- Dialog.SetMessage
- FileDialog.GetFilter
- FileDialog.GetPrompt
- FileDialog.SaveFileDialog
- FileDialog.SelectFolderDialog
- FileDialog.SetMessage
- FileDialog.SetUseSheet
- Path.AddPathComponent
- Path.LastPathComponent
- XL.Book.SaveToFile
Example Databases
- Archives/Show Zip File Content
- Containers/Container Batch Export
- CURL/Amazon S3/Amazon S3 Upload File
- Files/Audio File Tags
- Files/FileDialog
- Mac only/Icon and QuickLook/SetIcon
- Mac only/Movies/AVAsset Export Session
- Win Only/WindowsML
- XL/Writing data
- XL/XL Import and Export
Blog Entries
FileMaker Magazin
This function checks for a license.
Created 18th August 2014, last changed 27th April 2019
FileDialog.GetNameFieldStringValue - FileDialog.GetPathCount