MBS FileMaker Plugin Example Databases

Click Points

All examples are included with download of MBS FileMaker Plugin.

Click Points.fmp12

Overview
Tables2
Relationships1
Layouts2
Scripts5
Value Lists0
Custom Functions0
Custom Menus0
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
Image
6 fields defined, 1 record
Image
Dot
5 fields defined, 0 record
Dot

Fields

Table Name: Image - 6 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
ImageNormal, BinaryAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
      Mouse XNormal, TextAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
      • Indexing: None
      • Automatically create indexes as needed
      • Index Language: German
          Mouse YNormal, TextAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
              Original ImageNormal, BinaryAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Repetitions: 1
                  ImageIDNormal, NumberAuto-Enter:
                  • Allow editing
                  Validation:
                  • Only during data entry
                  Storage:
                  • Repetitions: 1
                  • Indexing: All
                  • Index Language: German
                    PDFNormal, BinaryAuto-Enter:
                    • Allow editing
                    Validation:
                    • Only during data entry
                    Storage:
                    • Repetitions: 1

                        Table Name: Dot - 5 Fields
                        Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
                        NameNormal, TextAuto-Enter:
                        • Allow editing
                        Validation:
                        • Only during data entry
                        Storage:
                        • Repetitions: 1
                        • Indexing: None
                        • Automatically create indexes as needed
                        • Index Language: German
                            XNormal, NumberAuto-Enter:
                            • Allow editing
                            Validation:
                            • Only during data entry
                            Storage:
                            • Repetitions: 1
                            • Indexing: None
                            • Automatically create indexes as needed
                            • Index Language: German
                                YNormal, NumberAuto-Enter:
                                • Allow editing
                                Validation:
                                • Only during data entry
                                Storage:
                                • Repetitions: 1
                                • Indexing: None
                                • Automatically create indexes as needed
                                • Index Language: German
                                    ColorNormal, TextAuto-Enter:
                                    • Allow editing
                                    Validation:
                                    • Only during data entry
                                    Storage:
                                    • Repetitions: 1
                                    • Indexing: None
                                    • Automatically create indexes as needed
                                    • Index Language: German
                                        ImageIDNormal, NumberAuto-Enter:
                                        • Allow editing
                                        Validation:
                                        • Only during data entry
                                        Storage:
                                        • Repetitions: 1
                                        • Indexing: All
                                        • Index Language: German

                                          Layout Objects: Image

                                          Regular Fields

                                          Field Name: Image::Image
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 62 pt
                                          • Left: 148 pt
                                          • Bottom: 542 pt
                                          • Right: 788 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: Image::Mouse X
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 255 pt
                                          • Left: 64 pt
                                          • Bottom: 276 pt
                                          • Right: 148 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: Image::Mouse Y
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 278 pt
                                          • Left: 64 pt
                                          • Bottom: 299 pt
                                          • Right: 148 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: Image::Original Image
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 511 pt
                                          • Left: 805 pt
                                          • Bottom: 558 pt
                                          • Right: 912 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: Dot::Name
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 64 pt
                                          • Left: 805 pt
                                          • Bottom: 85 pt
                                          • Right: 852 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: Dot::X
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 64 pt
                                          • Left: 854 pt
                                          • Bottom: 85 pt
                                          • Right: 901 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: Dot::Y
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 64 pt
                                          • Left: 903 pt
                                          • Bottom: 85 pt
                                          • Right: 950 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: Dot::Color
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 64 pt
                                          • Left: 952 pt
                                          • Bottom: 85 pt
                                          • Right: 999 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: Image::ImageID
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 90 pt
                                          • Left: 59 pt
                                          • Bottom: 111 pt
                                          • Right: 138 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: Image::PDF
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 431 pt
                                          • Left: 805 pt
                                          • Bottom: 478 pt
                                          • Right: 912 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

                                          Group Buttons

                                          Button PropertiesCoordinatesScript/Script Step
                                            Type:
                                          • Rectangle
                                            Additional Properties:
                                          • Rectangular
                                          • Top: 62 pt
                                          • Left: 148 pt
                                          • Bottom: 542 pt
                                          • Right: 788 pt
                                          • Anchoring: Left, Top
                                          Perform Script [ “Click” ]

                                          Scripts:


                                          Buttons

                                          Button PropertiesCoordinatesScript/Script Step
                                            Type:
                                          • Text: Convert to Image
                                          • Top: 436 pt
                                          • Left: 924 pt
                                          • Bottom: 478 pt
                                          • Right: 1014 pt
                                          • Anchoring: Left, Top
                                          Perform Script [ “Convert PDF to Image” ]

                                          Scripts:


                                          Portals

                                          Portal PropertiesCoordinatesFieldsOptions
                                          • Top: 61 pt
                                          • Left: 802 pt
                                          • Bottom: 388 pt
                                          • Right: 1002 pt
                                          • Anchoring: Left, Top
                                          Field Objects
                                          • Sort records: Off
                                          • Filter calculation: None
                                          • Initial Row: 1
                                          • Number of Rows: 13

                                          Layout Objects: Dot

                                          Regular Fields

                                          Field Name: Dot::Name
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 52 pt
                                          • Left: 138 pt
                                          • Bottom: 73 pt
                                          • Right: 391 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: Dot::X
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 75 pt
                                          • Left: 138 pt
                                          • Bottom: 96 pt
                                          • Right: 217 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: Dot::Y
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 98 pt
                                          • Left: 138 pt
                                          • Bottom: 119 pt
                                          • Right: 217 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: Dot::Color
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 121 pt
                                          • Left: 138 pt
                                          • Bottom: 142 pt
                                          • Right: 391 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: Dot::ImageID
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 144 pt
                                          • Left: 138 pt
                                          • Bottom: 165 pt
                                          • Right: 217 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

                                          Click
                                          Refresh
                                          InitDynaPDF
                                          Convert PDF to Image
                                          Clear

                                          Next Script: [Refresh]
                                          Script NameClick
                                          Run script with full access privilegesOff
                                          Include In MenuYes
                                          Layouts that use this script
                                          Scripts that use this script
                                            Script Definition
                                            Script Steps
                                            • #Find position of container on layout
                                            • Set Variable [ $pos; Value:FieldBounds ( Get(FileName) ; Get(LayoutName) ; "Image" ) ]
                                            • Set Variable [ $cx; Value:MiddleWords($pos; 1;1) ]
                                            • Set Variable [ $cy; Value:MiddleWords($pos; 2;1) ]
                                            • Set Variable [ $fx; Value:Get ( WindowLeft ) ]
                                            • Set Variable [ $fy; Value:Get ( WindowTop ) + 130 // 130 = height of toolbar with menubar ]
                                            • Set Variable [ $dx; Value:$cx + $fx ]
                                            • Set Variable [ $dy; Value:$cy + $fy ]
                                            • #Calculate position of mouse on screen relative to display
                                            • Set Variable [ $x; Value:MBS("RemoteControl.MouseX") - $dx ]
                                            • Set Variable [ $y; Value:MBS("RemoteControl.MouseY") - $dy ]
                                            • Set Field [ Image::Mouse X; $x ]
                                            • Set Field [ Image::Mouse Y; $y ]
                                            • #Create new record for point
                                            • Set Variable [ $planID; Value:Image::ImageID ]
                                            • Go to Layout [ “Dot” (Dot) ]
                                            • New Record/Request
                                            • Set Field [ Dot::Name; "neu" ]
                                            • Set Field [ Dot::ImageID; $planID ]
                                            • Set Field [ Dot::X; $x ]
                                            • Set Field [ Dot::Y; $y ]
                                            • Set Field [ Dot::Color; "#FF0000" ]
                                            • Commit Records/Requests [ Skip data entry validation; No dialog ]
                                            • Go to Layout [ “Image” (Image) ]
                                            • Perform Script [ “Refresh” ]
                                            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: [Click]Next Script: [InitDynaPDF]
                                                Script NameRefresh
                                                Run script with full access privilegesOff
                                                Include In MenuYes
                                                Layouts that use this script
                                                  Scripts that use this script
                                                  Script Definition
                                                  Script Steps
                                                  • #Query size of container on layout
                                                  • Set Variable [ $pos; Value:FieldBounds ( Get(FileName) ; Get(LayoutName) ; "Image" ) ]
                                                  • Set Variable [ $cx; Value:MiddleWords($pos; 1;1) ]
                                                  • Set Variable [ $cy; Value:MiddleWords($pos; 2;1) ]
                                                  • Set Variable [ $cr; Value:MiddleWords($pos; 3;1) ]
                                                  • Set Variable [ $cu; Value:MiddleWords($pos; 4;1) ]
                                                  • Set Variable [ $cw; Value:$cr-$cx ]
                                                  • Set Variable [ $ch; Value:$cu-$cy ]
                                                  • #Load image and draw points
                                                  • Set Variable [ $img; Value:MBS("GMImage.NewFromContainer"; Image::Original Image) ]
                                                  • Set Variable [ $i; Value:1 ]
                                                  • Set Variable [ $pw; Value:MBS("GMImage.GetWidth"; $img) ]
                                                  • Set Variable [ $ph; Value:MBS("GMImage.GetHeight"; $img) ]
                                                  • Go to Related Record [ From table: “Dot”; Using layout: “Dot” (Dot) ] [ Show only related records ]
                                                  • Go to Record/Request/Page [ First ]
                                                  • Loop
                                                  • #Draw one point
                                                  • Set Variable [ $x; Value:Dot::X * $pw / $cw ]
                                                  • Set Variable [ $y; Value:Dot::Y * $ph / $ch ]
                                                  • Set Variable [ $r; Value:MBS("GMImage.SetStrokeColor"; $img; "#00000000") ]
                                                  • Set Variable [ $r; Value:MBS("GMImage.SetFillColor"; $img; Dot::Color) ]
                                                  • Set Variable [ $r; Value:MBS("GMImage.SetLineWidth"; $img; 0) ]
                                                  • Set Variable [ $r; Value:MBS("GMImage.DrawCircle"; $img; $x; $y; $x+5; $y+5) ]
                                                  • Set Variable [ $i; Value:$i + 1 ]
                                                  • Go to Record/Request/Page [ Next; Exit after last ]
                                                  • End Loop
                                                  • #Save result
                                                  • Go to Related Record [ From table: “Image”; Using layout: “Image” (Image) ] [ Show only related records ]
                                                  • Set Field [ Image::Image; MBS("GMImage.WriteToPNGContainer"; $img; "test.png") ]
                                                  • Set Variable [ $r; Value:MBS("GMImage.Destroy"; $img) ]
                                                  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: [Refresh]Next Script: [Convert PDF to Image]
                                                        Script NameInitDynaPDF
                                                        Run script with full access privilegesOff
                                                        Include In MenuNo
                                                        Layouts that use this script
                                                          Scripts that use this script
                                                          Script Definition
                                                          Script Steps
                                                          • #Locate DynaPDF library
                                                          • Set Variable [ $databasePath; Value:Get(FilePath) ]
                                                          • Set Variable [ $databasePath; Value:MBS("Path.FilemakerPathToNativePath"; $databasePath) ]
                                                          • Set Variable [ $databasePath; Value:Substitute ( $databasePath ; ".fp7" ; ".fmp12") ]
                                                          • Set Variable [ $databaseName; Value:Get(FileName) & ".fmp12" ]
                                                          • If [ Get(SystemPlatform) = -2 ]
                                                          • Set Variable [ $path; Value:Substitute ( $databasePath ; $databaseName ; "dynapdf.dll" ) ]
                                                          • Else
                                                          • Set Variable [ $path; Value:Substitute ( $databasePath ; $databaseName ; "dynapdf.dylib" ) ]
                                                          • End If
                                                          • #Initialize DynaPDF
                                                          • Set Variable [ $r; Value:MBS( "DynaPDF.Initialize"; $path) ]
                                                          • If [ $r ≠ "OK" ]
                                                          • Show Custom Dialog [ Title: "DynaPDF failed to initialize"; Message: $r; Default Button: “OK”, Commit: “No”; Button 2: “Abbrechen”, Commit: “No” ]
                                                          • Else
                                                          • Set Variable [ $$DynaPDFInited; Value: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: [InitDynaPDF]Next Script: [Clear]
                                                                        Script NameConvert PDF to Image
                                                                        Run script with full access privilegesOff
                                                                        Include In MenuYes
                                                                        Layouts that use this script
                                                                        Scripts that use this script
                                                                          Script Definition
                                                                          Script Steps
                                                                          • #Initialize DynaPDF if needed
                                                                          • If [ MBS("DynaPDF.IsInitialized") ≠ 1 ]
                                                                          • Perform Script [ “InitDynaPDF” ]
                                                                          • End If
                                                                          • #Clear current PDF document
                                                                          • Set Variable [ $pdf; Value:MBS("DynaPDF.New") ]
                                                                          • #Render one page as Picture
                                                                          • Set Variable [ $r; Value:MBS("DynaPDF.OpenPDFFromContainer"; $pdf; Image::PDF) ]
                                                                          • Set Variable [ $r; Value:MBS("DynaPDF.ImportPDFPage"; $pdf; 1) ]
                                                                          • #Put in Container
                                                                          • Set Variable [ $image; Value:MBS("DynaPDF.RenderPage"; $pdf; 1; 0; 640; 480; 0; "RGB"; ""; "png") ]
                                                                          • Set Field [ Image::Original Image; $image ]
                                                                          • Set Field [ Image::Image; $image ]
                                                                          • Set Variable [ $r; Value:MBS("DynaPDF.Release"; $pdf) ]
                                                                          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: [Convert PDF to Image]
                                                                                Script NameClear
                                                                                Run script with full access privilegesOff
                                                                                Include In MenuYes
                                                                                Layouts that use this script
                                                                                  Scripts that use this script
                                                                                    Script Definition
                                                                                    Script Steps
                                                                                    • Set Field [ Image::Original Image; "" ]
                                                                                    • Set Field [ Image::Image; "" ]
                                                                                    • Truncate Table [ No dialog; Table: “Dot” ]
                                                                                    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: Click Points

                                                                                            Used functions:




                                                                                            Links
                                                                                            MBS Xojo PDF Plugins