DragDrop.RegisterDropTypes
--------------------------

Defines what file types should be accepted for drag and drop for this window.

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

MBS( "DragDrop.RegisterDropTypes"; droparea; Types ) 

**MBS**( **"DragDrop.RegisterDropTypes";** /\* Defines what file types should be accepted for drag and drop for this window. \*/  
**$droparea**; /\* The reference ID for this drop area.e.g. $dropHandle \*/   
**$Types**) /\* The types you want to accept for the window.   
This can be Cocoa native type specifications or some special types: "images" for all image types, "movies" for movie types, "file" for files, "URL" for URLs, "Email" for emails and "text" for text. If you use more than one type, separate them with comma.e.g. "images" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| droparea | The reference ID for this drop area. | $dropHandle |
| Types | The types you want to accept for the window.    This can be Cocoa native type specifications or some special types: "images" for all image types, "movies" for movie types, "file" for files, "URL" for URLs, "Email" for emails and "text" for text. If you use more than one type, separate them with comma. | "images" |

### Result

Returns "OK" on success.

### Description

Defines what file types should be accepted for drag and drop for this window.   
Call this function for each window where you want to define drag types. As FileMaker defines some types by itself, you don't need to call this method for every type.  
Version 2.7 adds "Emails" as type. You can receive Email drops from Apple Mail this way. The functions [DragDrop.GetEmailCount](DragDropGetEmailCount.md), [DragDrop.GetEmailID](DragDropGetEmailID.md), [DragDrop.GetEmailMailbox](DragDropGetEmailMailbox.md), [DragDrop.GetEmailAccount](DragDropGetEmailAccount.md) and [DragDrop.GetEmailSubject](DragDropGetEmailSubject.md) give you the details on received emails. GetURL gives URL of email if you received only one.  
  
For Version 9.2 or newer you can pass RTF and HTML for the types.  
### Examples

Registers for file drop for the current window:

 MBS ( "DragDrop.RegisterDropTypes"; $droparea ; "file")  
Create with control:

 Set Variable \[ $dropview ; Value: MBS ("[DragDrop.CreateWithControl](DragDropCreateWithControl.md)"; 0; "DropArea") \]   
Set Variable \[ $result ; Value: MBS ( "DragDrop.RegisterDropTypes"; $dropview ; "file") \]   
Set Variable \[ $result ; Value: MBS ( "[DragDrop.SetDragActionHandler](DragDropSetDragActionHandler.md)"; $dropview ; Get ( FileName ); "DragAction") \]   
Set Variable \[ $result ; Value: MBS ( "[DragDrop.SetCursor](DragDropSetCursor.md)"; $dropview ; 1) \]  
### See also

- [DragDrop.AttachToOverlay](DragDropAttachToOverlay.md)
- [DragDrop.AttachToWindow](DragDropAttachToWindow.md)
- [DragDrop.CreateWithWindow](DragDropCreateWithWindow.md)
- [DragDrop.GetEmailAccount](DragDropGetEmailAccount.md)
- [DragDrop.GetEmailCount](DragDropGetEmailCount.md)
- [DragDrop.GetEmailID](DragDropGetEmailID.md)
- [DragDrop.GetEmailMailbox](DragDropGetEmailMailbox.md)
- [DragDrop.GetEmailSubject](DragDropGetEmailSubject.md)
- [DragDrop.SetCursor](DragDropSetCursor.md)
- [DragDrop.SetDragActionHandler](DragDropSetDragActionHandler.md)

### Release notes

- **Version 11.1**
    - Changed [DragDrop.RegisterDropTypes](https://www.mbsplugins.eu/DragDropRegisterDropTypes.shtml) to use a better set of image pasteboard types to catch HEIF, too.

### Example Databases

- [Drag and Drop/DragTest](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Drag%20and%20Drop/DragTest.shtml#5ScriptAnchor_)
- [Drag and Drop/for Mac/DragTest Email](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Drag%20and%20Drop/for%20Mac/DragTest%20Email.shtml#5ScriptAnchor_)
- [Drag and Drop/for Mac/DragTest Image](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Drag%20and%20Drop/for%20Mac/DragTest%20Image.shtml#5ScriptAnchor_)
- [Drag and Drop/for Mac/DragTest multiple picture files](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Drag%20and%20Drop/for%20Mac/DragTest%20multiple%20picture%20files.shtml#5ScriptAnchor_)
- [Drag and Drop/for Mac/DragTest Text](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Drag%20and%20Drop/for%20Mac/DragTest%20Text.shtml#5ScriptAnchor_)
- [Drag and Drop/for Mac/DragTest URL](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Drag%20and%20Drop/for%20Mac/DragTest%20URL.shtml#5ScriptAnchor_)
- [Drag and Drop/for Mac/Image drag from one database to other/Image drop](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Drag%20and%20Drop/for%20Mac/Image%20drag%20from%20one%20database%20to%20other/Image%20drop.shtml#5ScriptAnchor_)
- [Drag and Drop/for Mac/Text drag from one database to other/Text drag](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Drag%20and%20Drop/for%20Mac/Text%20drag%20from%20one%20database%20to%20other/Text%20drag.shtml#5ScriptAnchor_)
- [Mac and iOS/Machine Learning/Core ML Photos](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/Machine%20Learning/Core%20ML%20Photos.shtml#4ScriptAnchor_)
- [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#5ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 11.1pr8](https://www.mbsplugins.de/archive/2021-03-04/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)
- [Accept file drops in Filemaker with MBS Plugin](https://www.mbsplugins.de/archive/2012-08-20/Accept_file_drops_in_Filemaker/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 13th March 2019

  
[DragDrop.List](DragDropList.md) - [DragDrop.Release](DragDropRelease.md)

[HTML Version](DragDropRegisterDropTypes.shtml)