FileDialog.GetPath
------------------

Queries the native path with the given index.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [FileDialog](component_FileDialog.md) | [2.7](newinversion27.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "FileDialog.GetPath" { ; Index } ) 

**MBS**( **"FileDialog.GetPath";** /\* Queries the native path with the given index. \*/  
**$Index**) /\* Optional; The index of the path.e.g. 0 \*/ 

### 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](PathNativePathToFileMakerPath.md) to convert to a FileMaker path if required.  
  
Please note that in sheet mode ([FileDialog.SetUseSheet](FileDialogSetUseSheet.md) 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](FileDialogReset.md)")\]  
Set Variable \[$r ; Value:MBS ("[FileDialog.SetMessage](FileDialogSetMessage.md)"; "Export folder?")\]  
Set Variable \[$r ; Value:MBS ("[FileDialog.SelectFolderDialog](FileDialogSelectFolderDialog.md)")\]  
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](PathNativePathToFileMakerPath.md)"; $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](PathLastPathComponent.md)"; $name )\]  
 Set Variable \[$dpath ; Value:MBS ( "[Path.AddPathComponent](PathAddPathComponent.md)"; $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](FileDialogReset.md)");  
r = MBS ("[FileDialog.SelectFolderDialog](FileDialogSelectFolderDialog.md)");  
folder = If ( r = "OK" ; MBS ("FileDialog.GetPath"; 0); "" )  
  
\]; folder)  
### See also

- [Dialog.SetMessage](DialogSetMessage.md)
- [FileDialog.GetFilter](FileDialogGetFilter.md)
- [FileDialog.GetPrompt](FileDialogGetPrompt.md)
- [FileDialog.SaveFileDialog](FileDialogSaveFileDialog.md)
- [FileDialog.SelectFolderDialog](FileDialogSelectFolderDialog.md)
- [FileDialog.SetMessage](FileDialogSetMessage.md)
- [FileDialog.SetUseSheet](FileDialogSetUseSheet.md)
- [Path.AddPathComponent](PathAddPathComponent.md)
- [Path.LastPathComponent](PathLastPathComponent.md)
- [XL.Book.SaveToFile](XLBookSaveToFile.md)

### Example Databases

- [Archives/Show Zip File Content](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Archives/Show%20Zip%20File%20Content.shtml#2ScriptAnchor_)
- [Containers/Container Batch Export](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Containers/Container%20Batch%20Export.shtml#1ScriptAnchor_)
- [CURL/Amazon S3/Amazon S3 Upload File](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Amazon%20S3/Amazon%20S3%20Upload%20File.shtml#6ScriptAnchor_)
- [Files/Audio File Tags](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Files/Audio%20File%20Tags.shtml#3ScriptAnchor_)
- [Files/FileDialog](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Files/FileDialog.shtml#1ScriptAnchor_)
- [Mac only/Icon and QuickLook/SetIcon](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20only/Icon%20and%20QuickLook/SetIcon.shtml#3ScriptAnchor_)
- [Mac only/Movies/AVAsset Export Session](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20only/Movies/AVAsset%20Export%20Session.shtml#1ScriptAnchor_)
- [Win Only/WindowsML](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Win%20Only/WindowsML.shtml#1ScriptAnchor_)
- [XL/Writing data](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/XL/Writing%20data.shtml#6ScriptAnchor_)
- [XL/XL Import and Export](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/XL/XL%20Import%20and%20Export.shtml#3ScriptAnchor_)

### Blog Entries

- [GraphicsMagick in FileMaker, part 3](https://www.mbsplugins.de/archive/2022-12-03/GraphicsMagick_in_FileMaker_pa/monkeybreadsoftware_blog_filemaker)
- [PDF Forms with MBS Plugin](https://www.mbsplugins.de/archive/2018-04-21/PDF_Forms_with_MBS_Plugin/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 6/2024, Seite 37](https://filemaker-magazin.de/neuigkeit/4277-Appetithappen-FMM_202406)
- [Ausgabe 1/2022, Seite 22](https://filemaker-magazin.de/neuigkeit/4172-Appetithappen-FMM_202201)
- [Ausgabe 1/2022, Seite 20](https://filemaker-magazin.de/neuigkeit/4172-Appetithappen-FMM_202201)
- [Ausgabe 6/2020, Seite 32](https://filemaker-magazin.de/neuigkeit/4118-Appetithappen-FMM_202006)
- [Ausgabe 4/2020, Seite 33](https://filemaker-magazin.de/neuigkeit/4103-Appetithappen-FMM_202004)
- [Ausgabe 4/2018, Seite 16](https://filemaker-magazin.de/neuigkeit/3997-Appetithappen-FMM_201804)
- [Ausgabe 3/2012, Seite 30 bis 31](https://filemaker-magazin.de/neuigkeit/3561-Appetithappen-FMM_201203)

This function checks for a license.

Created 18th August 2014 , last changed 27th April 2019

  
[FileDialog.GetNameFieldStringValue](FileDialogGetNameFieldStringValue.md) - [FileDialog.GetPathCount](FileDialogGetPathCount.md)

[HTML Version](FileDialogGetPath.shtml)