Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

MBS FileMaker Plugin Example Databases

DragTest

All examples are included with download of MBS FileMaker Plugin.

DragTest.fmp12

Overview
Tables 1
Relationships 0
Layouts 1
Scripts 9
Value Lists 0
Custom Functions 0
Custom Menus 33
File Options
Default custom menu set [Standard FileMaker Menus]
When opening file
Minimum allowed version 12.0
Login using Account Name; Account= Admin
Allow user to save password On
Require iOS passcode Off
Show Sign-in fields Off
Switch to layout Off
Hide all toolbars Off
Script triggers
OnFirstWindowOpen Off
OnLastWindowClose Off
OnWindowOpen Off
OnWindowClose Off
OnFileAVPlayerChange Off
OnWindowTransaction Off
Thumbnail Settings
Generate Thumbnails On; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
DragTest
6 fields defined, 0 record
DragTest

Fields

Table Name: DragTest - 6 Fields
Field Name Type Options Comments On Layouts In Relationships In Scripts In Value Lists
test Normal, Text Auto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
  • Indexing: None
  • Automatically create indexes as needed
  • Index Language: German
          field Normal, Binary Auto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
              DropLogo Normal, Binary Auto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Global
              • Repetitions: 1
                  Description Normal, Text Auto-Enter:
                  • Allow editing
                  Validation:
                  • Only during data entry
                  Storage:
                  • Repetitions: 1
                  • Indexing: None
                  • Automatically create indexes as needed
                  • Index Language: German
                      Text Normal, Text Auto-Enter:
                      • Allow editing
                      Validation:
                      • Only during data entry
                      Storage:
                      • Repetitions: 1
                      • Indexing: None
                      • Automatically create indexes as needed
                      • Index Language: German
                          MBSLogo Normal, Binary Auto-Enter:
                          • Allow editing
                          Validation:
                          • Only during data entry
                          Storage:
                          • Global
                          • Repetitions: 1

                              Layout Objects: DragTest

                              Regular Fields

                              Field Name: DragTest::field
                              Field Properties Coordinates Field Format Field Behavior Quick Find
                              • Top: 130 pt
                              • Left: 6 pt
                              • Bottom: 267 pt
                              • Right: 232 pt
                              • Anchoring: Left, Top
                              Field Format:
                              • Edit Box
                              Field Behavior:
                              • Allow field to be entered: In Find mode, In Browse mode
                              • Touch keyboard type: System Default
                              • Go to next field using: Tab key
                              No

                              Field Name: DragTest::Description
                              Field Properties Coordinates Field Format Field Behavior Quick Find
                              • Top: 130 pt
                              • Left: 644 pt
                              • Bottom: 242 pt
                              • Right: 854 pt
                              • Anchoring: Left, Top
                              Field Format:
                              • Edit Box
                              Field Behavior:
                              • Allow field to be entered: In Find mode, In Browse mode
                              • Touch keyboard type: Default for Data Type
                              • Go to next field using: Tab key
                              Yes

                              Field Name: DragTest::Text
                              Field Properties Coordinates Field Format Field Behavior Quick Find
                              • Top: 130 pt
                              • Left: 242 pt
                              • Bottom: 267 pt
                              • Right: 495 pt
                              • Anchoring: Left, Top
                              Field Format:
                              • Edit Box
                              Field Behavior:
                              • Allow field to be entered: In Find mode, In Browse mode
                              • Touch keyboard type: Default for Data Type
                              • Go to next field using: Tab key
                              Yes

                              Field Name: DragTest::MBSLogo
                              Field Properties Coordinates Field Format Field Behavior Quick Find
                              • Top: 279 pt
                              • Left: 72 pt
                              • Bottom: 320 pt
                              • Right: 151 pt
                              • Anchoring: Left, Top
                              Field Format:
                              • Edit Box
                              Field Behavior:
                              • Allow field to be entered: In Find mode, In Browse mode
                              • Touch keyboard type: Default for Data Type
                              • Go to next field using: Tab key
                              No

                              Field Name: DragTest::DropLogo
                              Field Properties Coordinates Field Format Field Behavior Quick Find
                              • Top: 279 pt
                              • Left: 232 pt
                              • Bottom: 320 pt
                              • Right: 311 pt
                              • Anchoring: Left, Top
                              Field Format:
                              • Edit Box
                              Field Behavior:
                              • Allow field to be entered: In Find mode, In Browse mode
                              • Touch keyboard type: Default for Data Type
                              • Go to next field using: Tab key
                              No

                              Script Hierarchy

                              DragAction
                              Import Email Attachments
                              SetupDrop
                              SetupDrop whole window
                              FreeDrop
                              Hide
                              Show
                              Create MBS Overlay Drop Target
                              Release All Overlays

                              Next Script: [Import Email Attachments]
                              Script Name DragAction
                              Run script with full access privileges Off
                              Siri Shortcut Visible Off
                              Include In Menu Yes
                              Layouts that use this script
                                Scripts that use this script
                                  Script Definition
                                  Script Steps
                                  • Set Variable [ $dropview; Value:Get(ScriptParameter) ]
                                  • Set Variable [ $names; Value:¶ ]
                                  • #check types
                                  • Set Variable [ $Types; Value:MBS("DragDrop.GetTypes"; $dropview) ]
                                  • #Check for paths in Drag & Drop
                                  • Set Variable [ $count; Value:MBS("DragDrop.GetPathCount"; $dropview) ]
                                  • If [ $count > 0 ]
                                  • Set Variable [ $index; Value:0 ]
                                  • Loop [ Flush: Always ]
                                  • Pause/Resume Script [ Duration (seconds): ,1 ]
                                  • Set Variable [ $path; Value:MBS("DragDrop.GetPath"; $dropview; $index) ]
                                  • If [ Length ( $path ) > 0 ]
                                  • If [ MBS("Files.FileExists"; $path) = 0 ]
                                  • #File not yet written? Wait a bit
                                  • Pause/Resume Script [ Duration (seconds): 1 ]
                                  • End If
                                  • Set Variable [ $name; Value:MBS( "Path.LastPathComponent"; $path) ]
                                  • Set Variable [ $names; Value:$names & $name & ¶ ]
                                  • New Record/Request
                                  • Set Field [ DragTest::field; MBS("Files.ReadFile"; $path; "auto") ]
                                  • Set Field [ DragTest::Text; $path ]
                                  • Set Field [ DragTest::Description; "Got via path list" ]
                                  • Commit Records/Requests [ No dialog ]
                                  • #Check email files and get the attachments separated
                                  • If [ Right ( $name; 4 ) = ".eml" ]
                                  • Perform Script [ “Import Email Attachments”; Parameter: $path ]
                                  • End If
                                  • End If
                                  • #next
                                  • Set Variable [ $index; Value:$index+1 ]
                                  • Exit Loop If [ $index = $count ]
                                  • End Loop
                                  • End If
                                  • #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 [ Flush: Always ]
                                  • 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") ]
                                  • Set Variable [ $pos; Value:Position ( $names; ¶ & $name & ¶; 1; 1) ]
                                  • If [ $pos = 0 ]
                                  • #not a duplicate
                                  • 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 [ No dialog ]
                                  • 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 [ No dialog ]
                                  • End If
                                  • Set Variable [ $names; Value:$names & $name & ¶ ]
                                  • End If
                                  • #next
                                  • Set Variable [ $index; Value:$index+1 ]
                                  • Exit Loop If [ $index = $count ]
                                  • End Loop
                                  • End If
                                  • #Check for text coming with Drag & Drop
                                  • Set Variable [ $text; Value:MBS("DragDrop.GetText"; $dropview) ]
                                  • If [ Length($text) > 0 ]
                                  • New Record/Request
                                  • Set Field [ DragTest::Text; $text ]
                                  • Set Field [ DragTest::Description; "Got text" ]
                                  • Commit Records/Requests [ No dialog ]
                                  • End If
                                  • #Check for text coming with Drag & Drop
                                  • Set Variable [ $text; Value:MBS("DragDrop.GetHTML"; $dropview) ]
                                  • If [ Length($text) > 0 ]
                                  • New Record/Request
                                  • Set Field [ DragTest::Text; $text ]
                                  • Set Field [ DragTest::Description; "Got HTML" ]
                                  • Commit Records/Requests [ No dialog ]
                                  • End If
                                  • #Check for text coming with Drag & Drop
                                  • Set Variable [ $text; Value:MBS("DragDrop.GetRTF"; $dropview) ]
                                  • If [ Length($text) > 0 ]
                                  • New Record/Request
                                  • Set Field [ DragTest::Text; $text ]
                                  • Set Field [ DragTest::Description; "Got RTF" ]
                                  • Commit Records/Requests [ No dialog ]
                                  • End If
                                  • #Check for Picture coming with Drag & Drop
                                  • Set Variable [ $pic; Value:MBS("DragDrop.GetPicture"; $dropview; "PNG") ]
                                  • If [ not IsEmpty($pic) ]
                                  • New Record/Request
                                  • Set Field [ DragTest::field; $pic ]
                                  • Set Field [ DragTest::Description; "Got Picture" ]
                                  • Commit Records/Requests [ No dialog ]
                                  • End If
                                  Fields used in this script
                                  Scripts used in this script
                                  Layouts used in this script
                                    Tables used in this script
                                    Table occurrences used by this script
                                    Custom Functions used by this script
                                      Custom menu set used by this script

                                        Previous Script: [DragAction] Next Script: [SetupDrop]
                                        Script Name Import Email Attachments
                                        Run script with full access privileges Off
                                        Siri Shortcut Visible Off
                                        Include In Menu Yes
                                        Layouts that use this script
                                          Scripts that use this script
                                          Script Definition
                                          Script Steps
                                          • Set Variable [ $path; Value:Get(ScriptParameter) ]
                                          • Set Variable [ $email; Value: MBS( "EmailParser.ParseFile"; $Path ) ]
                                          • If [ MBS("IsError") = 0 ]
                                          • #normal attachments
                                          • Set Variable [ $acount; Value:MBS( "EmailParser.AttachmentCount"; $Email ) ]
                                          • If [ $acount > 0 ]
                                          • Set Variable [ $aindex; Value:0 ]
                                          • Loop [ Flush: Always ]
                                          • New Record/Request
                                          • Set Field [ DragTest::field; MBS( "EmailParser.Attachment"; $Email; $aIndex; "container" ) ]
                                          • Set Field [ DragTest::Text; MBS( "EmailParser.Attachment"; $Email; $aIndex; "filename" ) ]
                                          • Set Field [ DragTest::Description; "attachment" ]
                                          • Commit Records/Requests [ No dialog ]
                                          • #next
                                          • Set Variable [ $aindex; Value:$aindex + 1 ]
                                          • Exit Loop If [ $aindex ≥ $acount ]
                                          • End Loop
                                          • Set Variable [ $r; Value:MBS( "EmailParser.free"; $Email ) ]
                                          • End If
                                          • #same for inline graphics
                                          • Set Variable [ $acount; Value:MBS( "EmailParser.InlineCount"; $Email ) ]
                                          • If [ $acount > 0 ]
                                          • Set Variable [ $aindex; Value:0 ]
                                          • Loop [ Flush: Always ]
                                          • New Record/Request
                                          • Set Field [ DragTest::field; MBS( "EmailParser.Inline"; $Email; $aIndex; "container" ) ]
                                          • Set Field [ DragTest::Text; MBS( "EmailParser.Inline"; $Email; $aIndex; "filename" ) ]
                                          • Set Field [ DragTest::Description; "inline graphics" ]
                                          • Commit Records/Requests [ No dialog ]
                                          • #next
                                          • Set Variable [ $aindex; Value:$aindex + 1 ]
                                          • Exit Loop If [ $aindex ≥ $acount ]
                                          • End Loop
                                          • Set Variable [ $r; Value:MBS( "EmailParser.free"; $Email ) ]
                                          • End If
                                          • End If
                                          Fields used in this script
                                          Scripts used in this script
                                            Layouts used in this script
                                              Tables used in this script
                                              Table occurrences used by this script
                                              Custom Functions used by this script
                                                Custom menu set used by this script

                                                  Previous Script: [Import Email Attachments] Next Script: [SetupDrop whole window]
                                                  Script Name SetupDrop
                                                  Run script with full access privileges Off
                                                  Siri Shortcut Visible Off
                                                  Include In Menu Yes
                                                  Layouts that use this script
                                                    Scripts that use this script
                                                      Script Definition
                                                      Script Steps
                                                      • #let FileMaker build the layout
                                                      • Pause/Resume Script [ Duration (seconds): ,1 ]
                                                      • #now add our control
                                                      • Set Variable [ $$dropview; Value:MBS("DragDrop.CreateWithControl"; 0 /* current */; "drop") ]
                                                      • Set Variable [ $result; Value:MBS( "DragDrop.RegisterDropTypes"; $$dropview; "file,rtf,text,html") ]
                                                      • Set Variable [ $result; Value:MBS( "DragDrop.SetDragActionHandler"; $$dropview; Get ( FileName ); "DragAction") ]
                                                      • Set Variable [ $result; Value:MBS( "DragDrop.SetCursor"; $$dropview; 1) ]
                                                      • If [ MBS("Container.GetCount"; DragTest::DropLogo) = 0 ]
                                                      • Show Custom Dialog [ Title: "Warning"; Message: "Logo for drop container is empty?"; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                      • Else
                                                      • Set Variable [ $result; Value:MBS( "DragDrop.SetImage"; $$dropview; DragTest::DropLogo) ]
                                                      • End If
                                                      Fields used in this script
                                                      Scripts used in this script
                                                        Layouts used in this script
                                                          Tables used in this script
                                                          Table occurrences used by this script
                                                          Custom Functions used by this script
                                                            Custom menu set used by this script

                                                              Previous Script: [SetupDrop] Next Script: [FreeDrop]
                                                              Script Name SetupDrop whole window
                                                              Run script with full access privileges Off
                                                              Siri Shortcut Visible Off
                                                              Include In Menu Yes
                                                              Layouts that use this script
                                                                Scripts that use this script
                                                                  Script Definition
                                                                  Script Steps
                                                                  • #let FileMaker build the layout
                                                                  • Pause/Resume Script [ Duration (seconds): ,1 ]
                                                                  • #now add our drop zone to the whole window
                                                                  • Set Variable [ $$dropview; Value:MBS("DragDrop.AttachToWindow"; 0 /* current */) ]
                                                                  • Set Variable [ $result; Value:MBS( "DragDrop.RegisterDropTypes"; $$dropview; "file,rtf,text,html") ]
                                                                  • Set Variable [ $result; Value:MBS( "DragDrop.SetDragActionHandler"; $$dropview; Get ( FileName ); "DragAction") ]
                                                                  • Set Variable [ $result; Value:MBS( "DragDrop.SetCursor"; $$dropview; 1) ]
                                                                  Fields used in this script
                                                                    Scripts used in this script
                                                                      Layouts used in this script
                                                                        Tables used in this script
                                                                          Table occurrences used by this script
                                                                            Custom Functions used by this script
                                                                              Custom menu set used by this script

                                                                                Previous Script: [SetupDrop whole window] Next Script: [Hide]
                                                                                Script Name FreeDrop
                                                                                Run script with full access privileges Off
                                                                                Siri Shortcut Visible Off
                                                                                Include In Menu Yes
                                                                                Layouts that use this script
                                                                                  Scripts that use this script
                                                                                    Script Definition
                                                                                    Script Steps
                                                                                    • If [ Length($$dropView) > 0 ]
                                                                                    • Set Variable [ $result; Value:MBS( "DragDrop.Release"; $$dropview) ]
                                                                                    • Set Variable [ $$dropview; Value:"" ]
                                                                                    • End If
                                                                                    Fields used in this script
                                                                                      Scripts used in this script
                                                                                        Layouts used in this script
                                                                                          Tables used in this script
                                                                                            Table occurrences used by this script
                                                                                              Custom Functions used by this script
                                                                                                Custom menu set used by this script

                                                                                                  Previous Script: [FreeDrop] Next Script: [Show]
                                                                                                  Script Name Hide
                                                                                                  Run script with full access privileges Off
                                                                                                  Siri Shortcut Visible Off
                                                                                                  Include In Menu Yes
                                                                                                  Layouts that use this script
                                                                                                    Scripts that use this script
                                                                                                      Script Definition
                                                                                                      Script Steps
                                                                                                      • If [ Length($$dropView) > 0 ]
                                                                                                      • Set Variable [ $result; Value:MBS( "DragDrop.SetVisible"; $$dropview; 0) ]
                                                                                                      • End If
                                                                                                      Fields used in this script
                                                                                                        Scripts used in this script
                                                                                                          Layouts used in this script
                                                                                                            Tables used in this script
                                                                                                              Table occurrences used by this script
                                                                                                                Custom Functions used by this script
                                                                                                                  Custom menu set used by this script

                                                                                                                    Previous Script: [Hide] Next Script: [Create MBS Overlay Drop Target]
                                                                                                                    Script Name Show
                                                                                                                    Run script with full access privileges Off
                                                                                                                    Siri Shortcut Visible Off
                                                                                                                    Include In Menu Yes
                                                                                                                    Layouts that use this script
                                                                                                                      Scripts that use this script
                                                                                                                        Script Definition
                                                                                                                        Script Steps
                                                                                                                        • If [ Length($$dropView) > 0 ]
                                                                                                                        • Set Variable [ $result; Value:MBS( "DragDrop.SetVisible"; $$dropview; 1) ]
                                                                                                                        • End If
                                                                                                                        Fields used in this script
                                                                                                                          Scripts used in this script
                                                                                                                            Layouts used in this script
                                                                                                                              Tables used in this script
                                                                                                                                Table occurrences used by this script
                                                                                                                                  Custom Functions used by this script
                                                                                                                                    Custom menu set used by this script

                                                                                                                                      Previous Script: [Show] Next Script: [Release All Overlays]
                                                                                                                                      Script Name Create MBS Overlay Drop Target
                                                                                                                                      Run script with full access privileges Off
                                                                                                                                      Siri Shortcut Visible Off
                                                                                                                                      Include In Menu Yes
                                                                                                                                      Layouts that use this script
                                                                                                                                        Scripts that use this script
                                                                                                                                          Script Definition
                                                                                                                                          Script Steps
                                                                                                                                          Fields used in this script
                                                                                                                                          Scripts used in this script
                                                                                                                                            Layouts used in this script
                                                                                                                                              Tables used in this script
                                                                                                                                              Table occurrences used by this script
                                                                                                                                              Custom Functions used by this script
                                                                                                                                                Custom menu set used by this script

                                                                                                                                                  Previous Script: [Create MBS Overlay Drop Target]
                                                                                                                                                  Script Name Release All Overlays
                                                                                                                                                  Run script with full access privileges Off
                                                                                                                                                  Siri Shortcut Visible Off
                                                                                                                                                  Include In Menu Yes
                                                                                                                                                  Layouts that use this script
                                                                                                                                                    Scripts that use this script
                                                                                                                                                      Script Definition
                                                                                                                                                      Script Steps
                                                                                                                                                      Fields used in this script
                                                                                                                                                        Scripts used in this script
                                                                                                                                                          Layouts used in this script
                                                                                                                                                            Tables used in this script
                                                                                                                                                              Table occurrences used by this script
                                                                                                                                                                Custom Functions used by this script
                                                                                                                                                                  Custom menu set used by this script

                                                                                                                                                                    Download example: DragTest

                                                                                                                                                                    Used functions: