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
Tables 1
Relationships 0
Layouts 1
Scripts 4
Value Lists 0
Custom Functions 0
Custom Menus 33
File Options
Default custom menu set [Standard FileMaker Menus]
Default theme Apex Blue
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
Barcode Generation
3 fields defined, 12 records
Barcode Generation

Fields

Table Name: Barcode Generation - 3 Fields
Field Name Type Options Comments On Layouts In Relationships In Scripts In Value Lists
Symbology Normal, Text Auto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
  • Indexing: None
  • Automatically create indexes as needed
  • Index Language: German
      Text Normal, Text Auto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
      • Indexing: None
      • Automatically create indexes as needed
      • Index Language: German
          Image Normal, Binary Auto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1

              Layout Objects: Barcode Generation

              Regular Fields

              Field Name: Barcode Generation::Symbology
              Field Properties Coordinates Field Format Field Behavior Quick 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 Properties Coordinates Field Format Field Behavior Quick 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 Properties Coordinates Field Format Field Behavior Quick 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 Properties Coordinates Script/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 Properties Coordinates Script/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
              Clear

              Next Script: [RunFile]
              Script Name Run
              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
                • 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 Name RunFile
                        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
                          • 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] Next Script: [Clear]
                                  Script Name Run with crop
                                  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
                                      • 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

                                              Previous Script: [Run with crop]
                                              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
                                                  • Replace Field Contents [ Barcode Generation::Image; Replace with calculation: "" ] [ 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: Barcode Generation

                                                          Used functions: