FileDialog.SetInitialDirectory
------------------------------

Sets the initial directory.

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

MBS( "FileDialog.SetInitialDirectory"; Path ) 

**MBS**( **"FileDialog.SetInitialDirectory";** /\* Sets the initial directory. \*/  
**$Path**) /\* The new path.e.g. "/Users/Shared" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Path | The new path. | "/Users/Shared" |

### Result

Returns OK.

### Description

Sets the initial directory.  
The path argument must be an absolute native path.  
Use [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md) to convert a FileMaker path to a native path if required.  
### Examples

Sets path on Mac:

 MBS ( "FileDialog.SetInitialDirectory"; "/Users/cs/Desktop" )  
Set path with space inside:

 MBS ( "FileDialog.SetInitialDirectory"; "/Users/cs/Desktop/Test Folder")  
Sets path on Mac with extra volume:

 MBS ( "FileDialog.SetInitialDirectory"; "/Volumes/Daten/Test Folder/Images" )  
Sets path on Windows:

 MBS ( "FileDialog.SetInitialDirectory"; "d:\\Test Daten\\Bilder" )  
### See also

- [FileDialog.GetInitialDirectory](FileDialogGetInitialDirectory.md)
- [FileDialog.OpenFileDialog](FileDialogOpenFileDialog.md)
- [FileDialog.SaveFileDialog](FileDialogSaveFileDialog.md)
- [FileDialog.SelectFolderDialog](FileDialogSelectFolderDialog.md)
- [FileDialog.SelectItemDialog](FileDialogSelectItemDialog.md)
- [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md)

### Example Databases

- [Files/FileDialog](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Files/FileDialog.shtml#1ScriptAnchor_)
- [SmartCard/Belgian EID Reader](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/SmartCard/Belgian%20EID%20Reader.shtml#13ScriptAnchor_)
- [Win Only/Windows Player](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Win%20Only/Windows%20Player.shtml#1ScriptAnchor_)

### Blog Entries

- [Tips and tricks with MBS](https://www.mbsplugins.de/archive/2023-08-10/Tips_and_tricks_with_MBS/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 18th August 2014 , last changed 18th August 2014

  
[FileDialog.SetFilter](FileDialogSetFilter.md) - [FileDialog.SetMessage](FileDialogSetMessage.md)

[HTML Version](FileDialogSetInitialDirectory.shtml)