DocumentPicker.Open
-------------------

Shows dialog to open files.

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

MBS( "DocumentPicker.Open"; AllowedUTIs; Flags { ; DirectoryPath } ) 

**MBS**( **"DocumentPicker.Open";** /\* Shows dialog to open files. \*/  
**$AllowedUTIs**; /\* The list of allowed universal types.e.g. "public.jpeg¶public.png" \*/   
**$Flags**; /\* Various flags.  
Value 1: Whether to allow multiple files to be selected. (iOS 11 or newer, otherwise ignored)  
Value 2: Whether to show file extensions (iOS 13 or newer, otherwise ignored)  
You can combine both flags and pass 1+2.e.g. 1 \*/   
**$DirectoryPath**) /\* Optional; The path to the directory to use as base.  
New in iOS 13.e.g. $documentFolderPath \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| AllowedUTIs | The list of allowed universal types. | "public.jpeg¶public.png" |  |
| Flags | Various flags.   Value 1: Whether to allow multiple files to be selected. (iOS 11 or newer, otherwise ignored)   Value 2: Whether to show file extensions (iOS 13 or newer, otherwise ignored)   You can combine both flags and pass 1+2. | 1 | Added in version **11.0**. |
| DirectoryPath | The path to the directory to use as base.   New in iOS 13. | $documentFolderPath | Optional      Added in version **11.0**. |

### Result

Returns OK or error.

### Description

Shows dialog to open files.  
The user selects an external document. The document picker provides access to the document, and the user can edit the document in place.  
  
On success, we store the list of file paths and trigger script. Script is trigger with parameter "Pick" or "Cancel".  
The paths list refers to the selected documents.  
  
Warning: Function returns immediately and dialog shows after function returned asynchronously.  
For FileMaker database files, please use com.filemaker.doc.fmp12 as UTI or simply public.data.  
### See also

- [DocumentPicker.Export](DocumentPickerExport.md)
- [DocumentPicker.File](DocumentPickerFile.md)
- [DocumentPicker.Files](DocumentPickerFiles.md)
- [DocumentPicker.Import](DocumentPickerImport.md)
- [DocumentPicker.Move](DocumentPickerMove.md)

### Release notes

- **Version 11.0**
    - Added new DirectoryPath parameter for [DocumentPicker.Import](https://www.mbsplugins.eu/DocumentPickerImport.shtml) and [DocumentPicker.Open](https://www.mbsplugins.eu/DocumentPickerOpen.shtml) functions.
    - Changed [DocumentPicker.Import](https://www.mbsplugins.eu/DocumentPickerImport.shtml) and [DocumentPicker.Open](https://www.mbsplugins.eu/DocumentPickerOpen.shtml) to make second parameter flags, so you can decide to show file name extensions.

### Example Databases

- [iOS/Examples/DocumentPicker iOS](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/iOS/Examples/DocumentPicker%20iOS.shtml#10ScriptAnchor_)
- [Mac and iOS/PDFKit/Printing iOS](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/PDFKit/Printing%20iOS.shtml#10ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 11.0pr5](https://www.mbsplugins.de/archive/2021-01-02/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 28th January 2019 , last changed 27th December 2020

  
[DocumentPicker.Move](DocumentPickerMove.md) - [DocumentPicker.SetTrigger](DocumentPickerSetTrigger.md)

[HTML Version](DocumentPickerOpen.shtml)