Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
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 | 2.4 | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |
MBS( "DragDrop.RegisterDropTypes"; droparea; Types ) More
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, DragDrop.GetEmailID, DragDrop.GetEmailMailbox, DragDrop.GetEmailAccount and DragDrop.GetEmailSubject 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"; 0; "DropArea") ]
Set Variable [ $result ; Value: MBS( "DragDrop.RegisterDropTypes"; $dropview; "file") ]
Set Variable [ $result ; Value: MBS( "DragDrop.SetDragActionHandler"; $dropview; Get ( FileName ); "DragAction") ]
Set Variable [ $result ; Value: MBS( "DragDrop.SetCursor"; $dropview; 1) ]
See also
- DragDrop.AttachToOverlay
- DragDrop.AttachToWindow
- DragDrop.CreateWithWindow
- DragDrop.GetEmailAccount
- DragDrop.GetEmailCount
- DragDrop.GetEmailID
- DragDrop.GetEmailMailbox
- DragDrop.GetEmailSubject
- DragDrop.SetCursor
- DragDrop.SetDragActionHandler
Release notes
- Version 11.1
- Changed DragDrop.RegisterDropTypes to use a better set of image pasteboard types to catch HEIF, too.
Example Databases
- Drag and Drop/DragTest Popover
- Drag and Drop/for Mac/DragTest Email
- Drag and Drop/for Mac/DragTest Image
- Drag and Drop/for Mac/DragTest multiple picture files
- Drag and Drop/for Mac/DragTest Text
- Drag and Drop/for Mac/DragTest URL
- Drag and Drop/for Mac/Image drag from one database to other/Image drop
- Drag and Drop/for Mac/Text drag from one database to other/Text drag
- Drag and Drop/for Mac/Text drag from one database to other/Text drop
- Mac and iOS/Machine Learning/Core ML Photos
Blog Entries
- MBS FileMaker Plugin, version 11.1pr8
- Adding Drag and Drop receiver to a layout
- Accept file drops in Filemaker with MBS Plugin
This function checks for a license.
Created 18th August 2014, last changed 13th March 2019