MBS FileMaker Plugin Example Databases

Text Wrap

All examples are included with download of MBS FileMaker Plugin.

Text Wrap.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts1
Value Lists1
Custom Functions1
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
Text
10 fields defined, 3 records
Text

Fields

Table Name: Text - 10 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
InputTextNormal, TextAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
  • Indexing: None
  • Automatically create indexes as needed
  • Index Language: German
      OutputTextNormal, TextAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
      • Indexing: None
      • Automatically create indexes as needed
      • Index Language: German
          Font PathNormal, TextAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
              Font SizeNormal, TextAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Repetitions: 1
              • Indexing: None
              • Automatically create indexes as needed
              • Index Language: German
                  Max Line LengthNormal, NumberAuto-Enter:
                  • Allow editing
                  Validation:
                  • Only during data entry
                  Storage:
                  • Repetitions: 1
                  • Indexing: None
                  • Automatically create indexes as needed
                  • Index Language: German
                      Max Character per LineNormal, NumberAuto-Enter:
                      • Allow editing
                      Validation:
                      • Only during data entry
                      Storage:
                      • Repetitions: 1
                      • Indexing: None
                      • Automatically create indexes as needed
                      • Index Language: German
                          DividerNormal, TextAuto-Enter:
                          • Allow editing
                          Validation:
                          • Only during data entry
                          Storage:
                          • Repetitions: 1
                          • Indexing: None
                          • Automatically create indexes as needed
                          • Index Language: German
                              CALC INPUT TEXTCalculated, TextCalculation: Auto-Enter:
                              • Always evaluate
                              Storage:
                              • Repetitions: 1
                              • Indexing: None
                              • Automatically create indexes as needed
                              • Index Language: German
                                    FontCalculated, TextCalculation: Auto-Enter:
                                    • Always evaluate
                                    Storage:
                                    • Repetitions: 1
                                    • Indexing: None
                                    • Automatically create indexes as needed
                                    • Index Language: German
                                          CALC OUTPUT TEXTCalculated, TextCalculation: Auto-Enter:
                                          • Always evaluate
                                          Storage:
                                          • Repetitions: 1
                                          • Indexing: None
                                          • Automatically create indexes as needed
                                          • Index Language: German

                                                Layout Objects: Text

                                                Regular Fields

                                                Field Name: Text::InputText
                                                Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                • Top: 52 pt
                                                • Left: 138 pt
                                                • Bottom: 261 pt
                                                • Right: 456 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

                                                Field Name: Text::OutputText
                                                Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                • Top: 270 pt
                                                • Left: 138 pt
                                                • Bottom: 479 pt
                                                • Right: 456 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

                                                Field Name: Text::Font Path
                                                Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                • Top: 481 pt
                                                • Left: 138 pt
                                                • Bottom: 502 pt
                                                • Right: 477 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

                                                Field Name: Text::Font Size
                                                Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                • Top: 504 pt
                                                • Left: 138 pt
                                                • Bottom: 525 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

                                                Field Name: Text::Max Line Length
                                                Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                • Top: 527 pt
                                                • Left: 138 pt
                                                • Bottom: 548 pt
                                                • Right: 881 pt
                                                • Anchoring: Left, Top
                                                Field Format:
                                                • Radio Button Set
                                                • Display values from: Lengths
                                                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

                                                Field Name: Text::Divider
                                                Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                • Top: 550 pt
                                                • Left: 138 pt
                                                • Bottom: 571 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

                                                Field Name: Text::Max Character per Line
                                                Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                • Top: 573 pt
                                                • Left: 138 pt
                                                • Bottom: 594 pt
                                                • Right: 217 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

                                                Field Name: Text::CALC INPUT TEXT
                                                Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                • Top: 52 pt
                                                • Left: 467 pt
                                                • Bottom: 261 pt
                                                • Right: 1367 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

                                                Field Name: Text::Font
                                                Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                • Top: 481 pt
                                                • Left: 479 pt
                                                • Bottom: 502 pt
                                                • Right: 621 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

                                                Field Name: Text::CALC OUTPUT TEXT
                                                Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                • Top: 270 pt
                                                • Left: 467 pt
                                                • Bottom: 479 pt
                                                • Right: 1367 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

                                                Button Bars

                                                Button Bar PropertiesCoordinates
                                                  Orientation:
                                                • horizontal
                                                • Top: 316 pt
                                                • Left: 40 pt
                                                • Bottom: 357 pt
                                                • Right: 127 pt
                                                • Anchoring: Left, Top
                                                Button Segments
                                                Button PropertiesCoordinatesScript/Script Step
                                                  Type:
                                                • Text:
                                                  Label Calculations:
                                                • "SET"
                                                • Top: 316 pt
                                                • Left: 40 pt
                                                • Bottom: 357 pt
                                                • Right: 127 pt
                                                Perform Script [ “Split” ]

                                                Scripts:


                                                Graphic Objects

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 52 pt
                                                • Left: 467 pt
                                                • Bottom: 261 pt
                                                • Right: 667 pt
                                                • Anchoring: Left, Top

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 52 pt
                                                • Left: 467 pt
                                                • Bottom: 261 pt
                                                • Right: 767 pt
                                                • Anchoring: Left, Top

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 52 pt
                                                • Left: 467 pt
                                                • Bottom: 261 pt
                                                • Right: 867 pt
                                                • Anchoring: Left, Top

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 52 pt
                                                • Left: 467 pt
                                                • Bottom: 261 pt
                                                • Right: 967 pt
                                                • Anchoring: Left, Top

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 52 pt
                                                • Left: 467 pt
                                                • Bottom: 261 pt
                                                • Right: 1067 pt
                                                • Anchoring: Left, Top

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 52 pt
                                                • Left: 467 pt
                                                • Bottom: 261 pt
                                                • Right: 1167 pt
                                                • Anchoring: Left, Top

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 52 pt
                                                • Left: 467 pt
                                                • Bottom: 261 pt
                                                • Right: 1267 pt
                                                • Anchoring: Left, Top

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 52 pt
                                                • Left: 467 pt
                                                • Bottom: 261 pt
                                                • Right: 717 pt
                                                • Anchoring: Left, Top

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 52 pt
                                                • Left: 467 pt
                                                • Bottom: 261 pt
                                                • Right: 817 pt
                                                • Anchoring: Left, Top

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 52 pt
                                                • Left: 467 pt
                                                • Bottom: 261 pt
                                                • Right: 917 pt
                                                • Anchoring: Left, Top

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 52 pt
                                                • Left: 467 pt
                                                • Bottom: 261 pt
                                                • Right: 1017 pt
                                                • Anchoring: Left, Top

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 52 pt
                                                • Left: 467 pt
                                                • Bottom: 261 pt
                                                • Right: 1117 pt
                                                • Anchoring: Left, Top

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 52 pt
                                                • Left: 467 pt
                                                • Bottom: 261 pt
                                                • Right: 1217 pt
                                                • Anchoring: Left, Top

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 270 pt
                                                • Left: 467 pt
                                                • Bottom: 479 pt
                                                • Right: 667 pt
                                                • Anchoring: Left, Top

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 270 pt
                                                • Left: 467 pt
                                                • Bottom: 479 pt
                                                • Right: 767 pt
                                                • Anchoring: Left, Top

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 270 pt
                                                • Left: 467 pt
                                                • Bottom: 479 pt
                                                • Right: 867 pt
                                                • Anchoring: Left, Top

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 270 pt
                                                • Left: 467 pt
                                                • Bottom: 479 pt
                                                • Right: 967 pt
                                                • Anchoring: Left, Top

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 270 pt
                                                • Left: 467 pt
                                                • Bottom: 479 pt
                                                • Right: 1067 pt
                                                • Anchoring: Left, Top

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 270 pt
                                                • Left: 467 pt
                                                • Bottom: 479 pt
                                                • Right: 1167 pt
                                                • Anchoring: Left, Top

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 270 pt
                                                • Left: 467 pt
                                                • Bottom: 479 pt
                                                • Right: 1267 pt
                                                • Anchoring: Left, Top

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 270 pt
                                                • Left: 467 pt
                                                • Bottom: 479 pt
                                                • Right: 717 pt
                                                • Anchoring: Left, Top

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 270 pt
                                                • Left: 467 pt
                                                • Bottom: 479 pt
                                                • Right: 817 pt
                                                • Anchoring: Left, Top

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 270 pt
                                                • Left: 467 pt
                                                • Bottom: 479 pt
                                                • Right: 917 pt
                                                • Anchoring: Left, Top

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 270 pt
                                                • Left: 467 pt
                                                • Bottom: 479 pt
                                                • Right: 1017 pt
                                                • Anchoring: Left, Top

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 270 pt
                                                • Left: 467 pt
                                                • Bottom: 479 pt
                                                • Right: 1117 pt
                                                • Anchoring: Left, Top

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 270 pt
                                                • Left: 467 pt
                                                • Bottom: 479 pt
                                                • Right: 1217 pt
                                                • Anchoring: Left, Top

                                                Value Lists

                                                Value List NameSourceValuesOn Layouts
                                                LengthsCustom
                                                • 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800

                                                Script Hierarchy

                                                Split

                                                Script NameSplit
                                                Run script with full access privilegesOff
                                                Include In MenuYes
                                                Layouts that use this script
                                                Scripts that use this script
                                                  Script Definition
                                                  Script Steps
                                                  • #Parameters from fields
                                                  • Set Variable [ $MaxLineLength; Value:Text::Max Line Length ]
                                                  • Set Variable [ $MaxLineCharacters; Value:Text::Max Character per Line ]
                                                  • Set Variable [ $Text; Value:Text::InputText ]
                                                  • Set Variable [ $Divider; Value:Text::Divider ]
                                                  • Set Variable [ $FontPath; Value:Text::Font Path ]
                                                  • Set Variable [ $FontSize; Value:Text::Font Size ]
                                                  • #Create dummy picture for measurement
                                                  • Set Variable [ $img; Value:MBS( "GMImage.New"; "200x200"; "white" ) ]
                                                  • Set Variable [ $r; Value:MBS( "GMImage.SetFontPointsize"; $img; $FontSize ) ]
                                                  • Set Variable [ $r; Value:MBS( "GMImage.SetFont"; $img; $FontPath ) ]
                                                  • #Start loop
                                                  • Set Variable [ $WordToTake; Value:0 ]
                                                  • Set Variable [ $Output; Value:"" ]
                                                  • Set Variable [ $WordCount; Value:WordCount($Text) ]
                                                  • Set Variable [ $WordIndex; Value:1 ]
                                                  • Loop
                                                  • Set Variable [ $WordToTake; Value:1 ]
                                                  • #Lets see if we would fit in one more word
                                                  • Loop
                                                  • Exit Loop If [ $WordIndex + $WordToTake = $WordCount + 1 ]
                                                  • #Get words
                                                  • Set Variable [ $Words; Value:MiddleWords ( $text ; $WordIndex ; $WordToTake+1) ]
                                                  • #Check if length would be to much and exit
                                                  • Exit Loop If [ Length($Words) > $MaxLineCharacters ]
                                                  • #Measure size
                                                  • Set Variable [ $Metrics; Value:MBS( "GMImage.FontTypeMetrics"; $img; $Words ) ]
                                                  • Set Variable [ $Width; Value:MBS( "Math.TextToNumber"; (GetValue($Metrics; 1))) ]
                                                  • If [ $Width < 1 ]
                                                  • Show Custom Dialog [ Title: "Width < 1 pixel?"; Message: "Font path is right?"; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                  • Exit Script [ ]
                                                  • End If
                                                  • #Check if width would be to much and exit
                                                  • Exit Loop If [ $Width > $MaxLineLength ]
                                                  • #A word more could be good
                                                  • Set Variable [ $WordToTake; Value:$WordToTake + 1 ]
                                                  • End Loop
                                                  • #Get the words we place here:
                                                  • Set Variable [ $Words; Value:MiddleWords ( $text ; $WordIndex ; $WordToTake) ]
                                                  • Set Variable [ $Output; Value:$Output & If(Length($Output) > 0; $Divider; "") & $Words ]
                                                  • #next
                                                  • Set Variable [ $WordIndex; Value:$WordIndex+$WordToTake ]
                                                  • Exit Loop If [ $WordIndex > $WordCount ]
                                                  • End Loop
                                                  • #Cleanup
                                                  • Set Variable [ $r; Value:MBS( "GMImage.destroy"; $img) ]
                                                  • #Put result in Field
                                                  • Set Field [ Text::OutputText; $output ]
                                                  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
                                                          GetFontNamePathAll accountsLet ( [ CNT = PatternCount ( Path ; "/" ) ; STRT = Position ( Path ; "/" ; 1 ; CNT ) + 1 ; END = Middle ( Path ; STRT ; Length ( Path ) ) ; CNTE = PatternCount ( END ; "." ) ; DOT = Position ( END ; "." ; 1 ; CNTE ) - 1 ; ENDE = Left ( END ; DOT ) ] ; ENDE )

                                                          Custom Menu Sets

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

                                                          Download example: Text Wrap

                                                          Used functions:




                                                          Links
                                                          MBS Xojo tutorial videos