| Components | All | New | MacOS | Windows | Linux | iOS | ||||
| Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old | |
DragDrop.GetFileDescriptor
Queries file descriptor.
| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
| DragDrop | 8.1 | ❌ No | ✅ Yes | ❌ No | ❌ No | ❌ No |
MBS( "DragDrop.GetFileDescriptor"; droparea; Index; Selector ) More
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-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
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
Release notes
- Version 12.5
- Fixed problem with DragDrop.GetFileDescriptor not working in v12.4.
Example Databases
Blog Entries
FileMaker Magazin
This function is free to use.
Created 5th February 2018, last changed 11st November 2020
MarkDown version: DragDropGetFileDescriptor.md