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

MBS FileMaker Plugin Example Databases

Barcode Generation

All examples are included with download of MBS FileMaker Plugin.

Barcode Generation.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
Barcode Generation
3 fields defined, 11 records
Barcode Generation

Fields

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

              Layout Objects: Barcode Generation

              Regular Fields

              Field Name: Barcode Generation::Symbology
              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
              • Top: 48 pt
              • Left: 6 pt
              • Bottom: 62 pt
              • Right: 133 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
              Yes

              Field Name: Barcode Generation::Text
              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
              • Top: 48 pt
              • Left: 138 pt
              • Bottom: 62 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
              Yes

              Field Name: Barcode Generation::Image
              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
              • Top: 48 pt
              • Left: 396 pt
              • Bottom: 173 pt
              • Right: 805 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

              Group Buttons

              Button PropertiesCoordinatesScript/Script Step
                Type:
              • Text: Generate Barcode
                Additional Properties:
              • Change to hand cursor over button
              • Rectangular
              • Top: 84 pt
              • Left: 138 pt
              • Bottom: 109 pt
              • Right: 277 pt
              • Anchoring: Left, Top
              Perform Script [ “Run” ]

              Scripts:


              Button PropertiesCoordinatesScript/Script Step
                Type:
              • Text: Write file to desktop
                Additional Properties:
              • Change to hand cursor over button
              • Rectangular
              • Top: 120 pt
              • Left: 138 pt
              • Bottom: 145 pt
              • Right: 277 pt
              • Anchoring: Left, Top
              Perform Script [ “RunFile” ]

              Scripts:


              Script Hierarchy

              Run
              RunFile
              Run with crop

              Next Script: [RunFile]
              Script NameRun
              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 [ Barcode Generation::Image; "" ]
                • Set Variable [ $img; Value:MBS( "Barcode.Generate"; /* Generates a barcode. */ Barcode Generation::Symbology; /* The symbology to use. e.g. EANX for EAN-13. Another possibility is to lookup the symbology code in the zint manual and pass the number here. EANX is 13 for example.e.g. "EANX" */ Barcode Generation::Text; /* The text to encode in the barcode.e.g. "12345" */ 0; /* Optional; The desired width of the barcode in pixels. Zero gives the auto size.e.g. 0 */ 0; /* Optional; The desired height of the barcode in pixels. Zero gives the auto size.e.g. 0 */ 0; /* Optional; The rotation. Can be 0, 90, 180 or 270.e.g. 0 */ 4; /* Optional; The scale of the target image.e.g. 1.0 */ 0; /* Optional; 0: black on white 1: black on transparent background 2: white on black (new in 7.2) 3: white on transparent background (new in 7.2)e.g. 1 */ 1; /* Optional; Whether to show text. Use 0 to hide text or 1 to show text.e.g. 1 */ "UTF-8") /* Optional; The text encoding for text parameter. Default is UTF-8.e.g. UTF8 */ ]
                • If [ MBS("IsError") = 0 ]
                • Set Field [ Barcode Generation::Image; MBS( "GMImage.WriteToPNGContainer"; $img; "barcode.png") ]
                • Set Variable [ $r; Value:MBS( "GMImage.Destroy"; $img ) ]
                • 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: [Run]Next Script: [Run with crop]
                        Script NameRunFile
                        Run script with full access privilegesOff
                        Include In MenuYes
                        Layouts that use this script
                        Scripts that use this script
                          Script Definition
                          Script Steps
                          • Set Variable [ $desktopPath; Value:MBS("Folders.UserDesktop") ]
                          • Set Variable [ $path; Value:MBS("Path.AddPathComponent"; $desktopPath; "barcode.svg") ]
                          • Set Variable [ $r; Value:MBS("Barcode.WriteFile"; "SVG"; $path; Barcode Generation::Symbology; Barcode Generation::Text) ]
                          • Set Variable [ $path; Value:MBS("Path.AddPathComponent"; $desktopPath; "barcode.ps") ]
                          • Set Variable [ $r; Value:MBS("Barcode.WriteFile"; "PS"; $path; Barcode Generation::Symbology; Barcode Generation::Text) ]
                          • Set Variable [ $path; Value:MBS("Path.AddPathComponent"; $desktopPath; "barcode.png") ]
                          • Set Variable [ $r; Value:MBS("Barcode.WriteFile"; "PNG"; $path; Barcode Generation::Symbology; Barcode Generation::Text) ]
                          • Set Variable [ $path; Value:MBS("Path.AddPathComponent"; $desktopPath; "barcode.jpg") ]
                          • Set Variable [ $r; Value:MBS("Barcode.WriteFile"; "JPEG"; $path; Barcode Generation::Symbology; Barcode Generation::Text) ]
                          • Set Variable [ $path; Value:MBS("Path.AddPathComponent"; $desktopPath; "barcode.gif") ]
                          • Set Variable [ $r; Value:MBS("Barcode.WriteFile"; "GIF"; $path; Barcode Generation::Symbology; Barcode Generation::Text) ]
                          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: [RunFile]
                                  Script NameRun with crop
                                  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 [ Barcode Generation::Image; "" ]
                                      • Set Variable [ $img; Value:MBS( "Barcode.Generate"; /* Generates a barcode. */ Barcode Generation::Symbology; /* The symbology to use. e.g. EANX for EAN-13. Another possibility is to lookup the symbology code in the zint manual and pass the number here. EANX is 13 for example.e.g. "EANX" */ Barcode Generation::Text; /* The text to encode in the barcode.e.g. "12345" */ 0; /* Optional; The desired width of the barcode in pixels. Zero gives the auto size.e.g. 0 */ 0; /* Optional; The desired height of the barcode in pixels. Zero gives the auto size.e.g. 0 */ 0; /* Optional; The rotation. Can be 0, 90, 180 or 270.e.g. 0 */ 8; /* Optional; The scale of the target image.e.g. 1.0 */ 0; /* Optional; 0: black on white 1: black on transparent background 2: white on black (new in 7.2) 3: white on transparent background (new in 7.2)e.g. 1 */ 1; /* Optional; Whether to show text. Use 0 to hide text or 1 to show text.e.g. 1 */ "UTF-8") /* Optional; The text encoding for text parameter. Default is UTF-8.e.g. UTF8 */ ]
                                      • If [ MBS("IsError") = 0 ]
                                      • #crop to top half
                                      • Set Variable [ $h; Value:MBS("GMImage.GetHeight"; $img) ]
                                      • Set Variable [ $w; Value:MBS("GMImage.GetWidth"; $img) ]
                                      • Set Variable [ $r; Value:MBS("GMImage.Crop"; $img; $w & "x" & ($h/2) & "+0+" & ($h/2)) ]
                                      • Set Field [ Barcode Generation::Image; MBS( "GMImage.WriteToPNGContainer"; $img; "barcode.png") ]
                                      • Set Variable [ $r; Value:MBS( "GMImage.Destroy"; $img ) ]
                                      • 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

                                              Download example: Barcode Generation

                                              Used functions: