DragDrop.GetFileDescriptor
--------------------------

Queries file descriptor.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DragDrop](component_DragDrop.md) | [8.1](newinversion81.md) | ❌ No | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "DragDrop.GetFileDescriptor"; droparea; Index; Selector ) 

**MBS**( **"DragDrop.GetFileDescriptor";** /\* Queries file descriptor. \*/  
**$droparea**; /\* The reference ID for this drop area.e.g. $dropHandle \*/   
**$Index**; /\* The index of the file descriptor from 0 to [DragDrop.GetFileDescriptorCount](DragDropGetFileDescriptorCount.md)-1.e.g. 0 \*/   
**$Selector**) /\* Which value to return.  
Can be Name, Size, Data or Path.e.g. "Name" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| droparea | The reference ID for this drop area. | $dropHandle |
| Index | The index of the file descriptor from 0 to [DragDrop.GetFileDescriptorCount](DragDropGetFileDescriptorCount.md)-1. | 0 |
| Selector | Which value to return.   Can be Name, Size, Data or Path. | "Name" |

### Result

Returns value or error.

### Description

Queries file descriptor.  
The file descriptor may include a file path and/or file data.  
The data is returned as container value.  
  
A Drag may include both a normal path and a file descriptor. So you may want to filter and not take both if they reference same file path.  
### Examples

Check for a file descriptor coming with Drag &amp; Drop:

 Set Variable \[ $count ; Value: MBS ("[DragDrop.GetFileDescriptorCount](DragDropGetFileDescriptorCount.md)"; $dropview ; "") \]   
If \[ $count &gt; 0 \]   
 Set Variable \[ $index ; Value: 0 \]   
 Loop  
 Pause/Resume Script \[ Duration (seconds): ,1 \]   
 Set Variable \[ $name ; Value: MBS ("DragDrop.GetFileDescriptor"; $dropview ; $index ; "name") \]   
 Set Variable \[ $data ; Value: MBS ("DragDrop.GetFileDescriptor"; $dropview ; $index ; "data") \]   
 Set Variable \[ $size ; Value: MBS ("DragDrop.GetFileDescriptor"; $dropview ; $index ; "size") \]   
 Set Variable \[ $path ; Value: MBS ("DragDrop.GetFileDescriptor"; $dropview ; $index ; "path") \]   
  
 If \[ Length ( $path ) &gt; 0 \]   
 New Record/Request  
 Set Field \[ DragTest::field ; MBS ("[Files.ReadFile](FilesReadFile.md)"; $path ; "auto") \]   
 Set Field \[ DragTest::Description ; "Got via file descriptor with path" \]   
 Set Field \[ DragTest::Text ; $path \]   
 Commit Records/Requests \[ With dialog: Off \]   
 Else If \[ $size &gt; 0 \]   
 New Record/Request  
 Set Field \[ DragTest::field ; $data \]   
 Set Field \[ DragTest::Text ; $name \]   
 Set Field \[ DragTest::Description ; "Got via file descriptor with data" \]   
 Commit Records/Requests \[ With dialog: Off \]   
 End If  
   
 # next  
 Set Variable \[ $index ; Value: $index +1 \]   
 Exit Loop If \[ $index = $count \]   
 End Loop  
End If  
### See also

- [DragDrop.GetFileDescriptorCount](DragDropGetFileDescriptorCount.md)
- [DragDrop.GetPath](DragDropGetPath.md)
- [Files.ReadFile](FilesReadFile.md)

### Release notes

- **Version 12.5**
    - Fixed problem with [DragDrop.GetFileDescriptor](https://www.mbsplugins.eu/DragDropGetFileDescriptor.shtml) not working in v12.4.

### Example Databases

- [Drag and Drop/DragTest Popover](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Drag%20and%20Drop/DragTest%20Popover.shtml#3ScriptAnchor_)
- [Drag and Drop/DragTest](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Drag%20and%20Drop/DragTest.shtml#3ScriptAnchor_)
- [Mac and iOS/PDFKit/PDF Merge Shrink Tool](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/PDFKit/PDF%20Merge%20Shrink%20Tool.shtml#3ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 12.5pr4](https://www.mbsplugins.de/archive/2022-10-24/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [Adding Drag and Drop receiver to a layout](https://www.mbsplugins.de/archive/2018-10-08/Adding_Drag_and_Drop_receiver_/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 2/2020, Seite 39](https://filemaker-magazin.de/neuigkeit/4089-Appetithappen-FMM_202002)

This function is free to use.

Created 5th February 2018 , last changed 11st November 2020

  
[DragDrop.GetEmailSubject](DragDropGetEmailSubject.md) - [DragDrop.GetFileDescriptorCount](DragDropGetFileDescriptorCount.md)

[HTML Version](DragDropGetFileDescriptor.shtml)