MBS FileMaker Plugin Example Databases

ImageGallery

All examples are included with download of MBS FileMaker Plugin.

ImageGallery.fmp12

Overview
Tables2
Relationships0
Layouts2
Scripts2
Value Lists0
Custom Functions2
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
Images
2 fields defined, 0 record
Images
ImageGallery
5 fields defined, 21 records
ImageGallery

Fields

Table Name: Images - 2 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
ImageNormal, BinaryAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
      FilenameNormal, TextAuto-Enter: Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
      • Indexing: None
      • Automatically create indexes as needed
      • Index Language: German

            Table Name: ImageGallery - 5 Fields
            Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
            Image1Calculated, BinaryCalculation: Storage:
            • Repetitions: 1
            • Do not store calculation results
                  Image2Calculated, BinaryCalculation: Storage:
                  • Repetitions: 1
                  • Do not store calculation results
                        Image3Calculated, BinaryCalculation: Storage:
                        • Repetitions: 1
                        • Do not store calculation results
                              Image4Calculated, BinaryCalculation: Storage:
                              • Repetitions: 1
                              • Do not store calculation results
                                    Image5Calculated, BinaryCalculation: Storage:
                                    • Repetitions: 1
                                    • Do not store calculation results

                                          Layout Objects: Images

                                          Regular Fields

                                          Field Name: Images::Image
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 52 pt
                                          • Left: 138 pt
                                          • Bottom: 177 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
                                          No

                                          Field Name: Images::Filename
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 179 pt
                                          • Left: 138 pt
                                          • Bottom: 200 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

                                          Buttons

                                          Button PropertiesCoordinatesScript/Script Step
                                            Type:
                                          • Text: Select Folder of Images
                                          • Top: 7 pt
                                          • Left: 846 pt
                                          • Bottom: 43 pt
                                          • Right: 1007 pt
                                          • Anchoring: Left, Top
                                          Perform Script [ “Import Image Folder” ]

                                          Scripts:


                                          Layout Objects: ImageGallery

                                          Regular Fields

                                          Field Name: ImageGallery::Image1
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 53 pt
                                          • Left: 5 pt
                                          • Bottom: 178 pt
                                          • Right: 258 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: ImageGallery::Image2
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 53 pt
                                          • Left: 266 pt
                                          • Bottom: 178 pt
                                          • Right: 519 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: ImageGallery::Image3
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 53 pt
                                          • Left: 527 pt
                                          • Bottom: 178 pt
                                          • Right: 780 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: ImageGallery::Image4
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 53 pt
                                          • Left: 788 pt
                                          • Bottom: 178 pt
                                          • Right: 1041 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: ImageGallery::Image5
                                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                          • Top: 53 pt
                                          • Left: 1049 pt
                                          • Bottom: 178 pt
                                          • Right: 1302 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

                                          Import Image Folder
                                          Refresh

                                          Next Script: [Refresh]
                                          Script NameImport Image Folder
                                          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 Layout [ “Images” (Images) ]
                                            • Set Variable [ $r; Value:MBS("FileDialog.Reset") ]
                                            • Set Variable [ $r; Value:MBS("FileDialog.SelectFolderDialog") ]
                                            • If [ $r = "OK" ]
                                            • Set Variable [ $index; Value:0 ]
                                            • Set Variable [ $count; Value:MBS("FileDialog.GetPathCount") ]
                                            • Loop
                                            • Set Variable [ $path; Value:MBS("FileDialog.GetPath"; $index) ]
                                            • Set Variable [ $list; Value:MBS( "Files.List"; $path; 1+4 ) ]
                                            • If [ MBS("IsError") = 0 ]
                                            • Set Variable [ $FileCount; Value:ValueCount ( $list ) ]
                                            • Set Variable [ $FileIndex; Value:1 ]
                                            • Loop
                                            • Set Variable [ $FileName; Value:GetValue($list; $fileIndex) ]
                                            • Set Variable [ $FilePath; Value:MBS( "Path.AddPathComponent"; $path; $filename ) ]
                                            • Set Variable [ $Image; Value:MBS( "Container.ReadFile"; $FilePath; "auto" ) ]
                                            • If [ MBS("IsError") = 0 ]
                                            • New Record/Request
                                            • Set Field [ Images::Image; $Image ]
                                            • Commit Records/Requests
                                            • End If
                                            • #next
                                            • Set Variable [ $FileIndex; Value:$FileIndex + 1 ]
                                            • Exit Loop If [ $FileIndex > $FileCount ]
                                            • End Loop
                                            • End If
                                            • #next
                                            • Set Variable [ $index; Value:$index + 1 ]
                                            • Exit Loop If [ $index = $count ]
                                            • End Loop
                                            • 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 Image Folder]
                                                  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
                                                      • Refresh Window [ Flush cached join results ]
                                                      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

                                                                    Custom Functions

                                                                    Function NameParametersAvailabilityDefinitionIn Field DefinitionsIn Scripts
                                                                    GetImagenRecord;nField;nFieldCountAll accountsLet ( [ n = (nRecord-1) * nFieldCount + nField-1; sql = MBS( "FM.SQL.Execute"; ""; "SELECT Image FROM Images OFFSET " & n & " ROWS FETCH FIRST 1 ROWS ONLY" ); error1 = MBS("IsError"); count = If(error1 = 0; MBS( "FM.SQL.RowCount"; sql; n; 0 ); ""); error2 = MBS("IsError"); value = If(error1 = 0 and 0 < count; MBS( "FM.SQL.Field"; sql; 0; 0 ); ""); error3 = MBS("IsError"); r = If(error1 = 0; MBS( "FM.SQL.Release"; sql ); "") ] ; If(error3 = 0 and error2 = 0 and error1 = 0; value; "") )
                                                                    ImagesCountPerRowAll accountsMin( 5; Max ( 1; Round ( Get ( WindowWidth ) / 266 ; 0)))

                                                                    Custom Menu Sets

                                                                    Menu SetsMenusIn ScriptsIn LayoutsComments
                                                                    [Standard FileMaker Menus]
                                                                    • All Standard Menus

                                                                    Download example: ImageGallery

                                                                    Used functions:




                                                                    Links
                                                                    MBS Xojo blog