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

MBS FileMaker Plugin Example Databases

Pick color from image via Screenshot

All examples are included with download of MBS FileMaker Plugin.

Pick color from image via Screenshot.fmp12

Overview
Tables1
Relationships1
Layouts2
Scripts3
Value Lists0
Custom Functions0
Custom Menus24
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
8 fields defined, 1 record
Image

Fields

Table Name: Image - 8 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
                          farbeNormal, TextAuto-Enter:
                          • Allow editing
                          Validation:
                          • Only during data entry
                          Storage:
                          • Repetitions: 1
                          • Indexing: None
                          • Automatically create indexes as needed
                          • Index Language: German
                              Farbfeld BigCalculated, TextCalculation:
                              • Context table: Image
                              • Let ([ x = Substitute ( Image::farbe ; " "; ¶) ; R = GetValue( x ; 2 ) / 257 ; G = GetValue( x ; 3 ) / 257 ; B = GetValue( x ; 4 ) / 257 ]; TextStyleAdd ( TextSize ( TextColor ( "█" ; RGB ( R ; G ; B ) ) ; 100 ) ; Bold + Condense ) )
                              Auto-Enter:
                              • Always evaluate
                              Storage:
                              • Repetitions: 1
                              • Do not store calculation results
                              • Index Language: German
                                    ScreenshotNormal, BinaryAuto-Enter:
                                    • Allow editing
                                    Validation:
                                    • Only during data entry
                                    Storage:
                                    • Repetitions: 1

                                        Layout Objects: Image

                                        Regular Fields

                                        Field Name: Image::Image
                                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                        • Top: 61 pt
                                        • Left: 147 pt
                                        • Bottom: 559 pt
                                        • Right: 805 pt
                                        • Anchoring: Left and Right, Top and Bottom
                                        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: 151 pt
                                        • Left: 64 pt
                                        • Bottom: 172 pt
                                        • Right: 143 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: 174 pt
                                        • Left: 64 pt
                                        • Bottom: 195 pt
                                        • Right: 143 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::farbe
                                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                        • Top: 241 pt
                                        • Left: 5 pt
                                        • Bottom: 323 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::Farbfeld Big
                                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                        • Top: 369 pt
                                        • Left: 5 pt
                                        • Bottom: 451 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::Screenshot
                                        Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                        • Top: 485 pt
                                        • Left: 5 pt
                                        • Bottom: 559 pt
                                        • Right: 138 pt
                                        • Anchoring: Left, Bottom
                                        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
                                          Object Name:
                                        • Image
                                        • Top: 61 pt
                                        • Left: 147 pt
                                        • Bottom: 559 pt
                                        • Right: 805 pt
                                        • Anchoring: Left and Right, Top and Bottom
                                        Perform Script [ “Click” ]

                                        Scripts:


                                        Buttons

                                        Button PropertiesCoordinatesScript/Script Step
                                          Type:
                                        • Text: Import Picture
                                        • Top: 10 pt
                                        • Left: 693 pt
                                        • Bottom: 42 pt
                                        • Right: 805 pt
                                        • Anchoring: Right, Top
                                        Perform Script [ “Import Picture” ]

                                        Scripts:


                                        Layout Objects: Dot

                                        Regular Fields

                                        Field Name: <Missing Field>
                                        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: <Missing Field>
                                        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: <Missing Field>
                                        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: <Missing Field>
                                        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: <Missing Field>
                                        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
                                        Clear
                                        Import Picture

                                        Next Script: [Clear]
                                        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
                                          • #short pause to let FileMaker redraw without gray overlay
                                          • Pause/Resume Script [ Duration (seconds): ,1 ]
                                          • #mouse position
                                          • Set Variable [ $x; Value:MBS("RemoteControl.MouseX") ]
                                          • Set Variable [ $y; Value:MBS("RemoteControl.MouseY") ]
                                          • Set Field [ Image::Mouse X; $x ]
                                          • Set Field [ Image::Mouse Y; $y ]
                                          • #take screenshot of area
                                          • Set Variable [ $screenshot; Value:MBS( "ScreenshotRect"; $x-8; $y-8; 17; 17; "JPEG"; 1024) ]
                                          • Set Field [ Image::Screenshot; $screenshot ]
                                          • #now pick color in middle
                                          • Set Variable [ $image; Value:MBS("GMImage.NewFromContainer"; $screenshot ) ]
                                          • Set Variable [ $color; Value:MBS("GMImage.GetPixelColor"; $Image; 8; 8) ]
                                          • Set Variable [ $error; Value:MBS("GMImage.Release";$Image) ]
                                          • Set Field [ Image::farbe; $color ]
                                          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: [Import Picture]
                                                  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::Image; "" ]
                                                      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: [Clear]
                                                              Script NameImport Picture
                                                              Run script with full access privilegesOff
                                                              Include In MenuYes
                                                              Layouts that use this script
                                                              Scripts that use this script
                                                                Script Definition
                                                                Script Steps
                                                                • Go to Field [ Image::Image ]
                                                                • Insert Picture [ ]
                                                                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: Pick color from image via Screenshot

                                                                        Used functions: