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

MBS FileMaker Plugin Example Databases

WordFile

All examples are included with download of MBS FileMaker Plugin.

WordFile.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts8
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
OnFirstWindowOpenScript: Clean
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
WordFile
6 fields defined, 9 records
WordFile

Fields

Table Name: WordFile - 6 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
InputNormal, BinaryAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Global
  • Repetitions: 1
      PlaceHolderNormal, 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
              ResultNormal, TextAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Repetitions: 1
              • Indexing: None
              • Automatically create indexes as needed
              • Index Language: German
                  NamesNormal, TextAuto-Enter:
                  • Allow editing
                  Validation:
                  • Only during data entry
                  Storage:
                  • Global
                  • Repetitions: 1
                  • Index Language: German
                      NewImageNormal, BinaryAuto-Enter:
                      • Allow editing
                      Validation:
                      • Only during data entry
                      Storage:
                      • Global
                      • Repetitions: 1

                          Layout Objects: WordFile

                          Regular Fields

                          Field Name: WordFile::Input
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 6 pt
                          • Left: 46 pt
                          • Bottom: 131 pt
                          • Right: 299 pt
                          • Anchoring: Left, Top
                          Field Format:
                          • Edit Box
                          Field Behavior:
                          • Allow field to be entered: In Find mode, In Browse mode
                          • Touch keyboard type: System Default
                          • Go to next field using: Tab key
                          No

                          Field Name: WordFile::PlaceHolder
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 162 pt
                          • Left: 6 pt
                          • Bottom: 181 pt
                          • Right: 259 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: WordFile::Text
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 162 pt
                          • Left: 264 pt
                          • Bottom: 181 pt
                          • Right: 517 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: WordFile::Result
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 162 pt
                          • Left: 522 pt
                          • Bottom: 181 pt
                          • Right: 775 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: WordFile::Names
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 36 pt
                          • Left: 485 pt
                          • Bottom: 139 pt
                          • Right: 665 pt
                          • Anchoring: Left, Top
                          Field Format:
                          • Edit Box
                          Field Behavior:
                          • Allow field to be entered: In Find mode, In Browse mode
                          • Touch keyboard type: Default for Data Type
                          • Go to next field using: Tab key
                          No

                          Field Name: WordFile::NewImage
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 36 pt
                          • Left: 678 pt
                          • Bottom: 139 pt
                          • Right: 879 pt
                          • Anchoring: Left, Top
                          Field Format:
                          • Edit Box
                          Field Behavior:
                          • Allow field to be entered: In Find mode, In Browse mode
                          • Touch keyboard type: Default for Data Type
                          • Go to next field using: Tab key
                          No

                          Buttons

                          Button PropertiesCoordinatesScript/Script Step
                            Type:
                          • Text: Replace Tags
                          • Top: 91 pt
                          • Left: 314 pt
                          • Bottom: 131 pt
                          • Right: 446 pt
                          • Anchoring: Left, Top
                          Perform Script [ “Run” ]

                          Scripts:


                          Script Hierarchy

                          Run
                          Clean
                          Run Fields
                          -
                          Show Media Files
                          Replace Image
                          -
                          Extract Text

                          Next Script: [Clean]
                          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
                            • #Find and replace Tags
                            • #load from container
                            • Set Variable [ $wordfile; Value:MBS( "WordFile.OpenContainer"; WordFile::Input ) ]
                            • If [ MBS("ISError") ]
                            • Show Custom Dialog [ Title: "Error"; Message: $wordFile; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                            • Exit Script [ ]
                            • End If
                            • #Check names
                            • Set Field [ WordFile::Names; MBS("WordFile.Tags"; $wordfile) ]
                            • #replace placeholders
                            • Go to Record/Request/Page [ First ]
                            • Loop
                            • Set Variable [ $r; Value:MBS( "WordFile.ReplaceTag"; $WordFile; WordFile::PlaceHolder; WordFile::Text) ]
                            • Set Field [ WordFile::Result; $r ]
                            • Commit Records/Requests
                            • Go to Record/Request/Page [ Next; Exit after last ]
                            • End Loop
                            • #add table row and fill in data
                            • Set Variable [ $r; Value:MBS( "WordFile.AppendTableRow"; $WordFile; "TName") ]
                            • Set Variable [ $r; Value:MBS( "WordFile.ReplaceTag"; $WordFile; "TName"; "Brochure 123") ]
                            • Set Variable [ $r; Value:MBS( "WordFile.ReplaceTag"; $WordFile; "TDescription"; "Restaurant Recommendations") ]
                            • #add table row and fill in data
                            • Set Variable [ $r; Value:MBS( "WordFile.AppendTableRow"; $WordFile; "TName") ]
                            • Set Variable [ $r; Value:MBS( "WordFile.ReplaceTag"; $WordFile; "TName"; "Brochure 456") ]
                            • Set Variable [ $r; Value:MBS( "WordFile.ReplaceTag"; $WordFile; "TDescription"; "Hotel Recommendations") ]
                            • #remove last row left
                            • Set Variable [ $r; Value:MBS( "WordFile.RemoveTableRow"; $WordFile; "TName") ]
                            • #write to desktop
                            • Set Variable [ $DesktopPath; Value:MBS("Folders.UserDesktop") ]
                            • Set Variable [ $FilePath; Value:MBS( "Path.AddPathComponent"; $DesktopPath; "test output.docx" ) ]
                            • Set Variable [ $r; Value:MBS( "WordFile.WriteFile"; $WordFile; $FilePath ) ]
                            • Set Variable [ $r; Value:MBS( "Files.LaunchFile"; $FilePath ) ]
                            • #clean up
                            • Set Variable [ $r; Value:MBS("WordFile.Release"; $WordFile) ]
                            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 Fields]
                                    Script NameClean
                                    Run script with full access privilegesOff
                                    Include In MenuYes
                                    Layouts that use this script
                                      Scripts that use this script
                                        Script Definition
                                        Script Steps
                                        • Go to Record/Request/Page [ First ]
                                        • Loop
                                        • Set Field [ WordFile::Result; "" ]
                                        • Commit Records/Requests
                                        • Go to Record/Request/Page [ Next; Exit after last ]
                                        • End Loop
                                        • Set Field [ WordFile::Names; "" ]
                                        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: [Clean]Next Script: [-]
                                                Script NameRun Fields
                                                Run script with full access privilegesOff
                                                Include In MenuYes
                                                Layouts that use this script
                                                  Scripts that use this script
                                                    Script Definition
                                                    Script Steps
                                                    • #Variant for form fields
                                                    • #load from container
                                                    • Set Variable [ $wordfile; Value:MBS( "WordFile.OpenContainer"; WordFile::Input ) ]
                                                    • If [ MBS("ISError") ]
                                                    • Show Custom Dialog [ Title: "Error"; Message: $wordFile; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                                                    • Exit Script [ ]
                                                    • End If
                                                    • #Check names
                                                    • Set Field [ WordFile::Names; MBS("WordFile.FieldNames"; $wordFile) ]
                                                    • #replace placeholders
                                                    • Go to Record/Request/Page [ First ]
                                                    • Loop
                                                    • Set Variable [ $fieldName; Value:WordFile::PlaceHolder ]
                                                    • Set Variable [ $oldText; Value:MBS( "WordFile.GetFieldText"; $WordFile; $fieldName) ]
                                                    • Set Variable [ $r; Value:MBS( "WordFile.SetFieldText"; $WordFile; $FieldName; WordFile::Text) ]
                                                    • Set Field [ WordFile::Result; $r ]
                                                    • Commit Records/Requests
                                                    • Go to Record/Request/Page [ Next; Exit after last ]
                                                    • End Loop
                                                    • #write to desktop
                                                    • Set Variable [ $DesktopPath; Value:MBS("Folders.UserDesktop") ]
                                                    • Set Variable [ $FilePath; Value:MBS( "Path.AddPathComponent"; $DesktopPath; "test output.docx" ) ]
                                                    • Set Variable [ $r; Value:MBS( "WordFile.WriteFile"; $WordFile; $FilePath ) ]
                                                    • Set Variable [ $r; Value:MBS( "Files.LaunchFile"; $FilePath ) ]
                                                    • #clean up
                                                    • Set Variable [ $r; Value:MBS("WordFile.Release"; $WordFile) ]
                                                    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 Fields]Next Script: [Show Media Files]
                                                            Script Name-
                                                            Run script with full access privilegesOff
                                                            Include In MenuYes
                                                            Layouts that use this script
                                                              Scripts that use this script
                                                                Script Definition
                                                                Script Steps
                                                                  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: [-]Next Script: [Replace Image]
                                                                                Script NameShow Media Files
                                                                                Run script with full access privilegesOff
                                                                                Include In MenuYes
                                                                                Layouts that use this script
                                                                                  Scripts that use this script
                                                                                    Script Definition
                                                                                    Script Steps
                                                                                    • #load from container
                                                                                    • Set Variable [ $wordfile; Value:MBS( "WordFile.OpenContainer"; WordFile::Input) ]
                                                                                    • If [ MBS("ISError") ]
                                                                                    • Show Custom Dialog [ Title: "Error"; Message: $wordFile; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                                                                                    • Exit Script [ ]
                                                                                    • End If
                                                                                    • #show
                                                                                    • Set Variable [ $names; Value:MBS( "WordFile.MediaFiles"; $WordFile ) ]
                                                                                    • Set Field [ WordFile::Names; $names ]
                                                                                    • If [ Length ( $names ) = 0 ]
                                                                                    • Show Custom Dialog [ Title: "Media files:"; Message: "none found"; Default Button: “OK”, Commit: “Yes” ]
                                                                                    • Else
                                                                                    • Show Custom Dialog [ Title: "Media files:"; Message: $names; Default Button: “OK”, Commit: “Yes” ]
                                                                                    • End If
                                                                                    • #clean up
                                                                                    • Set Variable [ $r; Value:MBS("WordFile.Release"; $WordFile) ]
                                                                                    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: [Show Media Files]Next Script: [-]
                                                                                            Script NameReplace Image
                                                                                            Run script with full access privilegesOff
                                                                                            Include In MenuYes
                                                                                            Layouts that use this script
                                                                                              Scripts that use this script
                                                                                                Script Definition
                                                                                                Script Steps
                                                                                                • #load from container
                                                                                                • Set Variable [ $wordfile; Value:MBS( "WordFile.OpenContainer"; WordFile::Input) ]
                                                                                                • If [ MBS("ISError") ]
                                                                                                • Show Custom Dialog [ Title: "Error"; Message: $wordFile; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                                                                                                • Exit Script [ ]
                                                                                                • End If
                                                                                                • #Replace image
                                                                                                • Set Variable [ $names; Value:MBS( "WordFile.MediaFiles"; $WordFile ) ]
                                                                                                • If [ Length ( $names ) = 0 ]
                                                                                                • Show Custom Dialog [ Title: "Replace Image"; Message: "No image in word file"; Default Button: “OK”, Commit: “Yes” ]
                                                                                                • Else
                                                                                                • #replace first image
                                                                                                • Set Variable [ $firstImage; Value:GetValue($names; 1) ]
                                                                                                • Set Variable [ $r; Value:MBS( "WordFile.SetMediaFile"; $WordFile; $firstImage; WordFile::NewImage) ]
                                                                                                • #write to desktop
                                                                                                • Set Variable [ $DesktopPath; Value:MBS("Folders.UserDesktop") ]
                                                                                                • Set Variable [ $FilePath; Value:MBS( "Path.AddPathComponent"; $DesktopPath; "test output.docx" ) ]
                                                                                                • Set Variable [ $r; Value:MBS( "WordFile.WriteFile"; $WordFile; $FilePath ) ]
                                                                                                • Set Variable [ $r; Value:MBS( "Files.LaunchFile"; $FilePath ) ]
                                                                                                • End If
                                                                                                • #clean up
                                                                                                • Set Variable [ $r; Value:MBS("WordFile.Release"; $WordFile) ]
                                                                                                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: [Replace Image]Next Script: [Extract Text]
                                                                                                        Script Name-
                                                                                                        Run script with full access privilegesOff
                                                                                                        Include In MenuYes
                                                                                                        Layouts that use this script
                                                                                                          Scripts that use this script
                                                                                                            Script Definition
                                                                                                            Script Steps
                                                                                                              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: [-]
                                                                                                                            Script NameExtract Text
                                                                                                                            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 [ $w; Value:MBS( "WordFile.OpenContainer"; WordFile::Input) ]
                                                                                                                                • If [ MBS("iserror") ]
                                                                                                                                • Show Custom Dialog [ Title: "Failed to read word file"; Message: $w; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                                                                                                                                • Exit Script [ ]
                                                                                                                                • End If
                                                                                                                                • Set Field [ WordFile::Names; MBS( "WordFile.Texts"; $w ) ]
                                                                                                                                • Show Custom Dialog [ Title: "Content"; Message: WordFile::Names; Default Button: “OK”, Commit: “Yes” ]
                                                                                                                                • Set Variable [ $r; Value:MBS( "WordFile.Release"; $w ) ]
                                                                                                                                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: WordFile

                                                                                                                                        Used functions: