Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.5   7.0   7.1   7.2   7.3   7.4   7.5   8.0   8.1   8.2    Statistic  

DragDrop.GetFileDescriptor

Queries file descriptor.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
DragDrop 8.1 No Yes No No No

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

Parameters

Parameter Description Example value
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.

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


DragDrop.GetEmailSubject   -   DragDrop.GetFileDescriptorCount

Feedback: Report problem or ask question.




Links
MBS Xojo PDF Plugins