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

MBS FileMaker Plugin Example Databases

Create GIF

All examples are included with download of MBS FileMaker Plugin.

Create GIF.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts3
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
Images
5 fields defined, 0 record
Images

Fields

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

                            Layout Objects: Images

                            Regular Fields

                            Field Name: Images::Image
                            Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                            • Top: 119 pt
                            • Left: 138 pt
                            • Bottom: 244 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: System Default
                            • Go to next field using: Tab key
                            No

                            Field Name: Images::MBS Image
                            Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                            • Top: 5 pt
                            • Left: 593 pt
                            • Bottom: 109 pt
                            • Right: 718 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::Size
                            Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                            • Top: 120 pt
                            • Left: 493 pt
                            • Bottom: 141 pt
                            • Right: 572 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: Create Images
                            • Top: 26 pt
                            • Left: 461 pt
                            • Bottom: 51 pt
                            • Right: 572 pt
                            • Anchoring: Left, Top
                            Perform Script [ “Create Images” ]

                            Scripts:


                            Button PropertiesCoordinatesScript/Script Step
                              Type:
                            • Text: Make GIF
                            • Top: 60 pt
                            • Left: 461 pt
                            • Bottom: 87 pt
                            • Right: 572 pt
                            • Anchoring: Left, Top
                            Perform Script [ “Create GIF” ]

                            Scripts:


                            Script Hierarchy

                            Create GIF
                            Create Images
                            Clear

                            Next Script: [Create Images]
                            Script NameCreate GIF
                            Run script with full access privilegesOff
                            Include In MenuYes
                            Layouts that use this script
                            Scripts that use this script
                              Script Definition
                              Script Steps
                              • #Create a GIF out of the images and save it on the desktop.
                              • #Create the storage path
                              • Set Variable [ $folder; Value:MBS( "Folders.UserDesktop" ) ]
                              • Set Variable [ $path; Value:MBS( "Path.AddPathComponent"; $folder; "test.gif" ) ]
                              • Set Variable [ $ImageList; Value:"" ]
                              • #Load images and set options
                              • Go to Record/Request/Page [ First ]
                              • Loop
                              • Set Variable [ $image; Value:MBS("GMImage.NewFromContainer"; Images::Image) ]
                              • Set Variable [ $r; Value:MBS("GMImage.SetGifDisposeMethod"; $image; 1) ]
                              • Set Variable [ $r; Value:MBS("GMImage.SetAnimationDelay"; $image; 10) ]
                              • Set Variable [ $r; Value:MBS("GMImage.SetAnimationIterations"; $image; 3) ]
                              • Set Variable [ $ImageList; Value:$ImageList & ¶ & $Image ]
                              • Set Field [ Images::ImageID; $Image ]
                              • Go to Record/Request/Page [ Next; Exit after last ]
                              • End Loop
                              • #Write GIF
                              • Set Variable [ $r; Value:MBS("GMImage.WriteImages"; $ImageList; $path; 1) ]
                              • #Free images
                              • Go to Record/Request/Page [ First ]
                              • Loop
                              • Set Variable [ $r; Value:MBS( "GMImage.Free"; Images::ImageID ) ]
                              • Set Field [ Images::ImageID; "" ]
                              • Go to Record/Request/Page [ Next; Exit after last ]
                              • End Loop
                              Fields used in this script
                              Scripts used in this script
                                Layouts used in this script
                                  Tables used in this script
                                  Table occurrences used by this script
                                  Custom Functions used by this script
                                    Custom menu set used by this script

                                      Previous Script: [Create GIF]Next Script: [Clear]
                                      Script NameCreate Images
                                      Run script with full access privilegesOff
                                      Include In MenuYes
                                      Layouts that use this script
                                      Scripts that use this script
                                        Script Definition
                                        Script Steps
                                        • #Store the image in different sizes in records.
                                        • Delete All Records [ No dialog ]
                                        • Set Variable [ $size; Value:10 ]
                                        • Loop
                                        • Set Variable [ $image; Value:MBS( "GMImage.New"; "350x350"; "white" ) ]
                                        • Set Variable [ $template; Value:MBS( "GMImage.NewFromContainer"; Images::MBS Image ) ]
                                        • Set Variable [ $r; Value:MBS( "GMImage.SetType"; $image; 6) ]
                                        • #scale image to the size
                                        • Set Variable [ $r; Value:MBS( "GMImage.Scale"; $template; GetAsNumber($size)) ]
                                        • #overlay the image. Now the image has a background (white). The last parameter is for the position
                                        • Set Variable [ $r; Value:MBS( "GMImage.CompositeXY"; $image; $template; (350-$size) / 2; (350-$size) / 2; 1) ]
                                        • New Record/Request
                                        • #write to container
                                        • Set Field [ Images::Image; MBS( "GMImage.WriteToPNGContainer"; $image) ]
                                        • Set Field [ Images::Size; $size ]
                                        • Commit Records/Requests [ No dialog ]
                                        • Set Variable [ $r; Value:MBS( "GMImage.Free"; $image ) ]
                                        • Set Variable [ $r; Value:MBS( "GMImage.Free"; $template ) ]
                                        • #determine size of the next picture
                                        • Set Variable [ $size; Value:$size + 10 ]
                                        • Exit Loop If [ $size > 350 ]
                                        • End Loop
                                        • Sort Records [ Keep records in sorted order; Specified Sort Order: Images::Size; ascending ] [ Restore; No dialog ]
                                        Fields used in this script
                                        Scripts used in this script
                                          Layouts used in this script
                                            Tables used in this script
                                            Table occurrences used by this script
                                            Custom Functions used by this script
                                              Custom menu set used by this script

                                                Previous Script: [Create Images]
                                                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
                                                    • #delete all images
                                                    • Go to Layout [ “Images” ]
                                                    • Delete All Records [ No dialog ]
                                                    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: Create GIF

                                                                Used functions: