MBS FileMaker Plugin Example Databases

DragTest

All examples are included with download of MBS FileMaker Plugin.

DragTest.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts4
Value Lists0
Custom Functions0
Custom Menus33
File Options
Default custom menu set[Standard FileMaker Menus]
When opening file
Minimum allowed version12.0
Login usingAccount Name; Account= Admin
Allow user to save passwordOff
Require iOS passcodeOff
Switch to layoutOff
Hide all toolbarsOff
Script triggers
OnFirstWindowOpenOff
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

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

Fields

Table Name: DragTest - 5 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
testNormal, TextAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
  • Indexing: None
  • Automatically create indexes as needed
  • Index Language: German
          fieldNormal, BinaryAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
              DropLogoNormal, BinaryAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Global
              • Repetitions: 1
                    DescriptionNormal, TextAuto-Enter:
                    • Allow editing
                    Validation:
                    • Only during data entry
                    Storage:
                    • Repetitions: 1
                    • Indexing: None
                    • Automatically create indexes as needed
                    • Index Language: German
                        TextNormal, TextAuto-Enter:
                        • Allow editing
                        Validation:
                        • Only during data entry
                        Storage:
                        • Repetitions: 1
                        • Indexing: None
                        • Automatically create indexes as needed
                        • Index Language: German

                            Layout Objects: DragTest

                            Regular Fields

                            Field Name: DragTest::field
                            Field PropertiesCoordinatesField FormatField BehaviorQuick 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 PropertiesCoordinatesField FormatField BehaviorQuick 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 PropertiesCoordinatesField FormatField BehaviorQuick 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

                            Script Hierarchy

                            DragAction
                            Import Email Attachments
                            SetupDrop
                            FreeDrop

                            Next Script: [Import Email Attachments]
                            Script NameDragAction
                            Run script with full access privilegesOff
                            Include In MenuYes
                            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 for paths in Drag & Drop
                                • Set Variable [ $count; Value:MBS("DragDrop.GetPathCount"; $dropview) ]
                                • If [ $count > 0 ]
                                • Set Variable [ $index; Value:0 ]
                                • Loop
                                • 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
                                • 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
                                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 NameImport Email Attachments
                                      Run script with full access privilegesOff
                                      Include In MenuYes
                                      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 ]
                                        • Set Variable [ $acount; Value:MBS( "EmailParser.AttachmentCount"; $Email ) ]
                                        • If [ $acount > 0 ]
                                        • Set Variable [ $aindex; Value:0 ]
                                        • Loop
                                        • 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
                                        • 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: [FreeDrop]
                                                Script NameSetupDrop
                                                Run script with full access privilegesOff
                                                Include In MenuYes
                                                Layouts that use this script
                                                  Scripts that use this script
                                                    Script Definition
                                                    Script Steps
                                                    • Set Variable [ $$dropview; Value:MBS("DragDrop.CreateWithControl"; Get(WindowName); "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]
                                                            Script NameFreeDrop
                                                            Run script with full access privilegesOff
                                                            Include In MenuYes
                                                            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

                                                                              Download example: DragTest

                                                                              Used functions:




                                                                              Links
                                                                              MBS FileMaker Plugins