PhotoPicker.File
----------------

Queries native file path for the image.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [PhotoPicker](component_PhotoPicker.md) | [12.5](newinversion125.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "PhotoPicker.File"; Index ) 

**MBS**( **"PhotoPicker.File";** /\* Queries native file path for the image. \*/  
**$Index**) /\* The index of the image.  
From 0 to [PhotoPicker.ImageCount](PhotoPickerImageCount.md)-1. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Index | The index of the image.   From 0 to [PhotoPicker.ImageCount](PhotoPickerImageCount.md)-1. | $index |

### Result

Returns file path or error.

### Description

Queries native file path for the image.  
### Examples

Process all the images:

 Set Variable \[ $ImageCount ; Value: MBS ("[PhotoPicker.ImageCount](PhotoPickerImageCount.md)") \]   
Set Variable \[ $index ; Value: 0 \]   
If \[ $index &lt; $ImageCount \]   
 Loop  
 # Process each image  
 Set Variable \[ $FilePath ; Value: MBS ("PhotoPicker.File"; $index ) \]   
 Set Variable \[ $Error ; Value: MBS ("[PhotoPicker.Error](PhotoPickerError.md)"; $index ) \]   
 #   
 If \[ Length ( $FilePath ) &gt; 0 \]   
 New Record/Request  
 If \[ Right ( $FilePath ; 5 ) = ".heic" \]   
 # special case for HEIC images -&gt; we convert them to PNG  
 Set Variable \[ $Image ; Value: MBS ( "[Container.ReadImageFile](ContainerReadImageFile.md)"; $FilePath ; "PNG"; "image.png") \]   
 Else  
 # all other files get imported  
 Set Variable \[ $Image ; Value: MBS ( "[Container.ReadFile](ContainerReadFile.md)"; $FilePath ) \]   
 End If  
 Set Field \[ ImagePicker::Picture ; $image \]   
 Commit Records/Requests \[ With dialog: Off \]   
 End If  
 #   
 # next  
 Set Variable \[ $index ; Value: $index + 1 \]   
 Exit Loop If \[ $index ≥ $ImageCount \]   
 End Loop  
End If  
Set Variable \[ $Image ; Value: MBS ( "[PhotoPicker.Clear](PhotoPickerClear.md)") \]  
### See also

- [Container.ReadFile](ContainerReadFile.md)
- [Container.ReadImage](ContainerReadImage.md)
- [Container.ReadImageFile](ContainerReadImageFile.md)
- [PhotoPicker.Clear](PhotoPickerClear.md)
- [PhotoPicker.Error](PhotoPickerError.md)
- [PhotoPicker.ImageCount](PhotoPickerImageCount.md)

### Example Databases

- [iOS/Examples/iOS Photo Picker](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/iOS/Examples/iOS%20Photo%20Picker.shtml#5ScriptAnchor_)

### Blog Entries

- [Top 10 from the MBS Plugin in 2022](https://www.mbsplugins.de/archive/2022-12-29/Top_10_from_the_MBS_Plugin_in_/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 12.5 News](https://www.mbsplugins.de/archive/2022-11-17/MBS_FileMaker_Plugin_125_News/monkeybreadsoftware_blog_filemaker)
- [PhotoPicker for iOS with FileMaker iOS SDK](https://www.mbsplugins.de/archive/2022-11-09/PhotoPicker_for_iOS_with_FileM/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 2/2025, Seite 18 bis 19](https://filemaker-magazin.de/neuigkeit/4286-Appetithappen-FMM_202502)

This function checks for a license.

Created 28th September 2022 , last changed 24th March 2023

  
[PhotoPicker.Error](PhotoPickerError.md) - [PhotoPicker.GetDisabledCapabilities](PhotoPickerGetDisabledCapabilities.md)

[HTML Version](PhotoPickerFile.shtml)