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

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 Menus24
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: 100 pt
                                                • Left: 138 pt
                                                • Bottom: 309 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: 318 pt
                                                • Left: 138 pt
                                                • Bottom: 527 pt
                                                • Right: 456 pt
                                                • Anchoring: Left, Top and Bottom
                                                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: 529 pt
                                                • Left: 138 pt
                                                • Bottom: 550 pt
                                                • Right: 477 pt
                                                • Anchoring: Left, Bottom
                                                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: 552 pt
                                                • Left: 138 pt
                                                • Bottom: 573 pt
                                                • Right: 391 pt
                                                • Anchoring: Left, Bottom
                                                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: 575 pt
                                                • Left: 138 pt
                                                • Bottom: 596 pt
                                                • Right: 881 pt
                                                • Anchoring: Left, Bottom
                                                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: 598 pt
                                                • Left: 138 pt
                                                • Bottom: 619 pt
                                                • Right: 391 pt
                                                • Anchoring: Left, Bottom
                                                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: 621 pt
                                                • Left: 138 pt
                                                • Bottom: 642 pt
                                                • Right: 217 pt
                                                • Anchoring: Left, Bottom
                                                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: 100 pt
                                                • Left: 467 pt
                                                • Bottom: 309 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: 529 pt
                                                • Left: 479 pt
                                                • Bottom: 550 pt
                                                • Right: 621 pt
                                                • Anchoring: Left, Bottom
                                                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: 318 pt
                                                • Left: 467 pt
                                                • Bottom: 527 pt
                                                • Right: 1367 pt
                                                • Anchoring: Left, Top and Bottom
                                                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: Set
                                                • Top: 611 pt
                                                • Left: 425 pt
                                                • Bottom: 642 pt
                                                • Right: 504 pt
                                                • Anchoring: Left, Bottom
                                                Perform Script [ “Split” ]

                                                Scripts:


                                                Graphic Objects

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                Graphic Object PropertiesCoordinates
                                                  Type:
                                                • Rectangle
                                                • Top: 318 pt
                                                • Left: 467 pt
                                                • Bottom: 527 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
                                                  • #This script sets the text to a certain line length
                                                  • #Parameters from fields
                                                  • Set Variable [ $MaxLineLength; Value:Text::Max Line Length ]
                                                  • Set Variable [ $MaxLineCharacters; Value:Text::Max Character per Line ]
                                                  • Set Variable [ $InputText; 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 ) ]
                                                  • #process new lines if exist in input text
                                                  • Set Variable [ $InputText; Value:Substitute($InputText; ¶&¶; Char(10)) ]
                                                  • Set Variable [ $InputText; Value:Substitute($InputText; ¶; " ") ]
                                                  • Set Variable [ $InputText; Value:Substitute($InputText; Char(10); ¶) ]
                                                  • Set Variable [ $Output; Value:"" ]
                                                  • Set Variable [ $LineCount; Value:ValueCount($InputText) ]
                                                  • Set Variable [ $Line; Value:1 ]
                                                  • If [ $Line ≤ $LineCount ]
                                                  • Loop
                                                  • #your script steps here
                                                  • Set Variable [ $Text; Value:GetValue($InputText; $Line) ]
                                                  • Set Variable [ $Text; Value:Substitute($Text; " "; ¶) ]
                                                  • #Start loop
                                                  • Set Variable [ $WordCount; Value:ValueCount($Text) ]
                                                  • Set Variable [ $WordIndex; Value:1 ]
                                                  • Set Variable [ $WordText; Value:"" ]
                                                  • Loop
                                                  • Set Variable [ $WordText; Value:GetValue($Text; $WordIndex) ]
                                                  • Set Variable [ $WordIndex; Value:$WordIndex + 1 ]
                                                  • #Lets see if we would fit in one more word
                                                  • Loop
                                                  • Exit Loop If [ $WordIndex > $WordCount ]
                                                  • #Get words
                                                  • Set Variable [ $NewWord; Value:GetValue($Text; $WordIndex) ]
                                                  • Set Variable [ $NewWordText; Value:$WordText & " " & $NewWord ]
                                                  • #Check if length would be to much and exit
                                                  • Exit Loop If [ Length($NewWordText) > $MaxLineCharacters ]
                                                  • #Measure size
                                                  • Set Variable [ $Metrics; Value:MBS( "GMImage.FontTypeMetrics"; $img; $NewWordText ) ]
                                                  • 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
                                                  • Set Variable [ $Width; Value:$width + 4 // a bit of margin added ]
                                                  • Exit Loop If [ $Width > $MaxLineLength ]
                                                  • #A word more could be good
                                                  • Set Variable [ $WordText; Value:$NewWordText ]
                                                  • Set Variable [ $WordIndex; Value:$WordIndex + 1 ]
                                                  • End Loop
                                                  • #Get the words we place here:
                                                  • Set Variable [ $Output; Value:$Output & If(Length($Output) > 0; $Divider; "") & $WordText ]
                                                  • #next
                                                  • Exit Loop If [ $WordIndex > $WordCount ]
                                                  • End Loop
                                                  • #next
                                                  • Set Variable [ $Line; Value:$Line + 1 ]
                                                  • Exit Loop If [ $Line > $LineCount ]
                                                  • Set Variable [ $Output; Value:$Output & ¶ ]
                                                  • End Loop
                                                  • End If
                                                  • #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: