FileDialog.SelectItemDialog
---------------------------

Shows dialog to select either file or folder.

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

MBS( "FileDialog.SelectItemDialog" ) ### Parameters

none

### Result

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

### Description

Shows dialog to select either file or folder.  
If dialog finishes well, you can query paths.  
  
To select just a file, please use [FileDialog.OpenFileDialog](FileDialogOpenFileDialog.md) function.  
Calls [FileDialog.OpenFileDialog](FileDialogOpenFileDialog.md) on Windows.  
### Examples

Run Select Item Dialog:

 Delete All Records \[No dialog\]  
Set Variable \[$r ; Value:MBS ("[FileDialog.Reset](FileDialogReset.md)")\]  
Set Variable \[$r ; Value:MBS ("[FileDialog.SetShowHidden](FileDialogSetShowHidden.md)"; FileDialog::ShowHidden )\]  
Set Variable \[$r ; Value:MBS ("[FileDialog.SetAllowMulti](FileDialogSetAllowMulti.md)"; FileDialog::AllowMulti )\]  
Set Variable \[$r ; Value:MBS ("[FileDialog.SetResolvesAliases](FileDialogSetResolvesAliases.md)"; FileDialog::ResolvesAliases )\]  
Set Variable \[$r ; Value:MBS ("[FileDialog.SetTreatsFilePackagesAsDirectories](FileDialogSetTreatsFilePackagesAsDirectories.md)"; FileDialog::TreatsFilePackagesAsDirectories )\]  
Set Variable \[$r ; Value:MBS ("[FileDialog.SetCanSelectHiddenExtension](FileDialogSetCanSelectHiddenExtension.md)"; FileDialog::CanSelectHiddenExtension )\]  
Set Variable \[$r ; Value:MBS ("[FileDialog.SetWindowTitle](FileDialogSetWindowTitle.md)"; FileDialog::WindowTitle )\]  
Set Variable \[$r ; Value:MBS ("[FileDialog.SetInitialDirectory](FileDialogSetInitialDirectory.md)"; FileDialog::InitialDirectory )\]  
Set Variable \[$r ; Value:MBS ("[FileDialog.SetNameFieldLabel](FileDialogSetNameFieldLabel.md)"; FileDialog::NameFieldLabel )\]  
Set Variable \[$r ; Value:MBS ("[FileDialog.SetPrompt](FileDialogSetPrompt.md)"; FileDialog::Prompt )\]  
Set Variable \[$r ; Value:MBS ("[FileDialog.SetMessage](FileDialogSetMessage.md)"; FileDialog::Message )\]  
Set Variable \[$r ; Value:MBS ("[FileDialog.SetNameFieldStringValue](FileDialogSetNameFieldStringValue.md)"; FileDialog::NameFieldStringValue )\]  
Set Variable \[$r ; Value:MBS ("FileDialog.SelectItemDialog")\]  
If \[$r = "OK"\]  
 Set Variable \[$index ; Value:0\]  
 Set Variable \[$count ; Value:MBS ("[FileDialog.GetPathCount](FileDialogGetPathCount.md)")\]  
 Loop  
 New Record/Request  
 Set Field \[FileDialog::Path ; MBS ("[FileDialog.GetPath](FileDialogGetPath.md)"; $index )\]  
 Commit Records/Requests \[\]  
 Set Variable \[$index ; Value:$index + 1\]  
 Exit Loop If \[$index = $count \]  
 End Loop  
End If  
### See also

- [FileDialog.OpenFileDialog](FileDialogOpenFileDialog.md)
- [FileDialog.Reset](FileDialogReset.md)
- [FileDialog.SelectFolderDialog](FileDialogSelectFolderDialog.md)
- [FileDialog.SetAllowMulti](FileDialogSetAllowMulti.md)
- [FileDialog.SetMessage](FileDialogSetMessage.md)
- [FileDialog.SetNameFieldLabel](FileDialogSetNameFieldLabel.md)
- [FileDialog.SetPrompt](FileDialogSetPrompt.md)
- [FileDialog.SetShowHidden](FileDialogSetShowHidden.md)
- [FileDialog.SetTreatsFilePackagesAsDirectories](FileDialogSetTreatsFilePackagesAsDirectories.md)
- [FileDialog.SetWindowTitle](FileDialogSetWindowTitle.md)

### Release notes

- **Version 9.4**
    - Added check to [FileDialog.OpenFileDialog](http://www.mbsplugins.eu/FileDialogOpenFileDialog.shtml), [FileDialog.SaveFileDialog](http://www.mbsplugins.eu/FileDialogSaveFileDialog.shtml), [FileDialog.SelectFolderDialog](http://www.mbsplugins.eu/FileDialogSelectFolderDialog.shtml) and [FileDialog.SelectItemDialog](http://www.mbsplugins.eu/FileDialogSelectItemDialog.shtml) to ignore invalid initial directory for Mac.

### Example Databases

- [Files/FileDialog](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Files/FileDialog.shtml#5ScriptAnchor_)
- [Mac only/Icon and QuickLook/SetIcon](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20only/Icon%20and%20QuickLook/SetIcon.shtml#3ScriptAnchor_)

### Blog Entries

- [Tips and tricks with MBS](https://www.mbsplugins.de/archive/2023-08-10/Tips_and_tricks_with_MBS/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 9.4pr7](https://www.mbsplugins.de/archive/2019-09-12/MBS_FileMaker_Plugin_version_9/monkeybreadsoftware_blog_filemaker)
- [Comparing Base Elements Plugin to MBS FileMaker Plugin](https://www.mbsplugins.de/archive/2017-10-24/Comparing_Base_Elements_Plugin/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 17th June 2018

  
[FileDialog.SelectFolderDialog](FileDialogSelectFolderDialog.md) - [FileDialog.SetAllowMulti](FileDialogSetAllowMulti.md)

[HTML Version](FileDialogSelectItemDialog.shtml)