Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
DragDrop.GetFileDescriptor
Queries file descriptor.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| DragDrop | 8.1 | No | Yes | No | No | No |
Parameters
| Parameter | Description | Example |
|---|---|---|
| droparea | The reference ID for this drop area. Use functions like DragDrop.CreateWithControl to create a drop area. | $dropHandle |
| Index | The index of the file descriptor from 0 to DragDrop.GetFileDescriptorCount-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 & Drop:
Set Variable [ $count ; Value: MBS("DragDrop.GetFileDescriptorCount"; $dropview; "") ]
If [ $count > 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 ) > 0 ]
New Record/Request
Set Field [ DragTest::field ; MBS("Files.ReadFile"; $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 > 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
Example Databases
Blog Entries
FileMaker Magazin
Created 5th February 2018, last changed 11st November 2020
DragDrop.GetEmailSubject - DragDrop.GetFileDescriptorCount
Feedback: Report problem or ask question.
Links
MBS Xojo tutorial videos