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
Tables 1
Relationships 0
Layouts 1
Scripts 3
Value Lists 0
Custom Functions 0
Custom Menus 33
File Options
Default custom menu set [Standard FileMaker Menus]
Default theme Enlightened
When opening file
Minimum allowed version 12.0
Login using Account Name; Account= Admin
Allow user to save password On
Require iOS passcode Off
Show Sign-in fields Off
Switch to layout Off
Hide all toolbars Off
Script triggers
OnFirstWindowOpen Off
OnLastWindowClose Off
OnWindowOpen Off
OnWindowClose Off
OnFileAVPlayerChange Off
OnWindowTransaction Off
Thumbnail Settings
Generate Thumbnails On; Temporary

 

Tables

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

Fields

Table Name: Images - 5 Fields
Field Name Type Options Comments On Layouts In Relationships In Scripts In Value Lists
Path Normal, Text Auto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Global
  • Repetitions: 1
  • Index Language: German
          Image Normal, Binary Auto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
              ImageID Normal, Text Auto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Repetitions: 1
              • Indexing: None
              • Automatically create indexes as needed
              • Index Language: German
                    MBS Image Normal, Binary Auto-Enter:
                    • Allow editing
                    Validation:
                    • Only during data entry
                    Storage:
                    • Global
                    • Repetitions: 1
                        Size Normal, Number Auto-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 Properties Coordinates Field Format Field Behavior Quick 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 Properties Coordinates Field Format Field Behavior Quick 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 Properties Coordinates Field Format Field Behavior Quick 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 Properties Coordinates Script/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 Properties Coordinates Script/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 Name Create GIF
                            Run script with full access privileges Off
                            Siri Shortcut Visible Off
                            Include In Menu Yes
                            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 [ Flush: Always ]
                              • 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 [ Flush: Always ]
                              • 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 Name Create Images
                                      Run script with full access privileges Off
                                      Siri Shortcut Visible Off
                                      Include In Menu Yes
                                      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 [ Flush: Always ]
                                        • 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 Name Clear
                                                Run script with full access privileges Off
                                                Siri Shortcut Visible Off
                                                Include In Menu Yes
                                                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: