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

MBS FileMaker Plugin Example Databases

TinyMCE

All examples are included with download of MBS FileMaker Plugin.

TinyMCE.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts6
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 layoutTinyMCE
Hide all toolbarsOff
Script triggers
OnFirstWindowOpenScript: StartUP
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
TinyMCE
2 fields defined, 1 record
TinyMCE

Fields

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

          Layout Objects: TinyMCE

          Regular Fields

          Field Name: TinyMCE::Text
          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
          • Top: 24 pt
          • Left: 66 pt
          • Bottom: 248 pt
          • Right: 403 pt
          • Anchoring: Left, Top
          Field Format:
          • Edit Box
          Field Behavior:
          • Allow field to be entered: In Find mode, In Browse mode
          • Disable visual spell-checking
          • Touch keyboard type: System Default
          • Go to next field using: Tab key
          Yes

          Field Name: TinyMCE::HTMLText
          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
          • Top: 24 pt
          • Left: 480 pt
          • Bottom: 248 pt
          • Right: 841 pt
          • Anchoring: Left, Top
          Field Format:
          • Edit Box
          Field Behavior:
          • Allow field to be entered: In Find mode, In Browse mode
          • Disable visual spell-checking
          • Touch keyboard type: System Default
          • Go to next field using: Tab key
          Yes

          Group Buttons

          Button PropertiesCoordinatesScript/Script Step
            Type:
          • Text: Set
            Additional Properties:
          • Change to hand cursor over button
          • Rounded
          • Top: 255 pt
          • Left: 66 pt
          • Bottom: 280 pt
          • Right: 133 pt
          • Anchoring: Left, Top
          Perform Script [ “Load” ]

          Scripts:


          Button PropertiesCoordinatesScript/Script Step
            Type:
          • Text: Get
            Additional Properties:
          • Change to hand cursor over button
          • Rounded
          • Top: 255 pt
          • Left: 480 pt
          • Bottom: 280 pt
          • Right: 547 pt
          • Anchoring: Left, Top
          Perform Script [ “Save” ]

          Scripts:


          Button PropertiesCoordinatesScript/Script Step
            Type:
          • Text: <<
            Additional Properties:
          • Change to hand cursor over button
          • Rounded
          • Top: 111 pt
          • Left: 420 pt
          • Bottom: 136 pt
          • Right: 463 pt
          • Anchoring: Left, Top
          Set Field [ TinyMCE::Text; TinyMCE::HTMLText ]

          Fields:


          Button PropertiesCoordinatesScript/Script Step
            Type:
          • Text: Show
            Additional Properties:
          • Change to hand cursor over button
          • Rectangular
          • Top: 630 pt
          • Left: 132 pt
          • Bottom: 655 pt
          • Right: 193 pt
          • Anchoring: Left, Top
          Set Variable [ $r; Value:MBS( "WebView.RunJavaScript" ; "HTMLEditor"; "tinyMCE.get('elm1').show();" ) ]

          Button PropertiesCoordinatesScript/Script Step
            Type:
          • Text: Hide
            Additional Properties:
          • Change to hand cursor over button
          • Rectangular
          • Top: 630 pt
          • Left: 66 pt
          • Bottom: 655 pt
          • Right: 127 pt
          • Anchoring: Left, Top
          Set Variable [ $r; Value:MBS( "WebView.RunJavaScript" ; "HTMLEditor"; "tinyMCE.get('elm1').hide();" ) ]

          Web Viewer Controls

          Web Viewer Control PropertiesCoordinatesWeb Address
            Object Name:
          • HTMLEditor
            Additional Properties:
          • Allow interaction with web viewer content
          • Automatically encode URL
          • Top: 288 pt
          • Left: 66 pt
          • Bottom: 613 pt
          • Right: 841 pt
          • Anchoring: Left, Top

          Script Hierarchy

          StartUP
          WebViewer
          Save
          Load
          Reset
          Insert Text

          Next Script: [WebViewer]
          Script NameStartUP
          Run script with full access privilegesOff
          Include In MenuYes
          Layouts that use this script
            Scripts that use this script
              Script Definition
              Script Steps
              • #enable debug
              • // Set Variable [ $result; Value:MBS("Trace") ]
              • #init webviewer extension
              • If [ Get ( HostApplicationVersion ) = "" /* on server? */ ]
              • #find HTML code
              • Set Variable [ $databasePath; Value:Get(FilePath) ]
              • Set Variable [ $databasePath; Value:MBS("Path.FilemakerPathToNativePath"; $databasePath) ]
              • Set Variable [ $databasePath; Value:Substitute ( $databasePath ; ".fp7" ; ".fmp12") ]
              • Set Variable [ $databaseName; Value:Get(FileName) & ".fmp12" ]
              • Set Variable [ $path; Value:Substitute ( $databasePath ; $databaseName ; "tinymce/index.html" ) ]
              • If [ Get ( SystemPlatform ) = -2 or GetAsNumber ( Get(ApplicationVersion)) ≥ 16 ]
              • Set Variable [ $path; Value:"file://" & Substitute ( $path; "\\" ; "/" ) ]
              • End If
              • Set Web Viewer [ Object Name: "HTMLEditor"; URL: $path ]
              • Else
              • Set Web Viewer [ Object Name: "HTMLEditor"; URL: "http://www.monkeybreadsoftware.com/filemaker/examples/tinymce/index.html" ]
              • End If
              Fields used in this script
                Scripts used in this script
                  Layouts used in this script
                    Tables used in this script
                      Table occurrences used by this script
                        Custom Functions used by this script
                          Custom menu set used by this script

                            Previous Script: [StartUP]Next Script: [Save]
                            Script NameWebViewer
                            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: [WebViewer]Next Script: [Load]
                                        Script NameSave
                                        Run script with full access privilegesOff
                                        Include In MenuYes
                                        Layouts that use this script
                                        Scripts that use this script
                                          Script Definition
                                          Script Steps
                                          • #run Javascript to move html into form field
                                          • Set Variable [ $r; Value:MBS( "WebView.RunJavaScript" ; "HTMLEditor"; "try { formtest.output.value = tinyMCE.get('elm1').getContent(); } catch (e) { alert(e); }" ) ]
                                          • #pick text from form field
                                          • Set Variable [ $text; Value:MBS( "WebView.GetFormTextAreaValue" ; "HTMLEditor"; "formtest"; "output"; 0 ) ]
                                          • #Replace new line characters to ¶ like FMP prefers them
                                          • Set Variable [ $text; Value:MBS( "Text.ReplaceNewline"; $text; 1) ]
                                          • #Remove any control codes
                                          • Set Variable [ $text; Value:MBS( "Text.RemoveControlCharacters"; $text) ]
                                          • #Put in field
                                          • Set Field [ TinyMCE::HTMLText; $text ]
                                          • #Remove the unload handler which could make trouble
                                          • Set Variable [ $r; Value:MBS( "WebView.RunJavaScript" ; "HTMLEditor"; "window.onbeforeunload = null;") ]
                                          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: [Save]Next Script: [Reset]
                                                  Script NameLoad
                                                  Run script with full access privilegesOff
                                                  Include In MenuYes
                                                  Layouts that use this script
                                                  Scripts that use this script
                                                    Script Definition
                                                    Script Steps
                                                    • #Change line endings to LF
                                                    • Set Variable [ $text; Value:MBS( "Text.ReplaceNewline"; TinyMCE::Text; 2) ]
                                                    • #Put text in form field
                                                    • Set Variable [ $r; Value:MBS( "WebView.SetFormTextAreaValue" ; "HTMLEditor"; "formtest"; "output"; $text; 0 ) ]
                                                    • #Put text in javascript
                                                    • Set Variable [ $r; Value:MBS( "WebView.RunJavaScript" ; "HTMLEditor"; "try { tinyMCE.get('elm1').setContent(formtest.output.value); } catch (e) { alert(e); }" ) ]
                                                    • #clear unload handler to avoid trouble
                                                    • Set Variable [ $r; Value:MBS( "WebView.RunJavaScript" ; "HTMLEditor"; "window.onbeforeunload = null;") ]
                                                    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: [Load]Next Script: [Insert Text]
                                                            Script NameReset
                                                            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 [ $r; Value:MBS( "WebView.RunJavaScript" ; "HTMLEditor"; "window.onbeforeunload = null;") ]
                                                                • Set Web Viewer [ Object Name: "HTMLEditor"; Action: Reset ]
                                                                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: [Reset]
                                                                              Script NameInsert Text
                                                                              Run script with full access privilegesOff
                                                                              Include In MenuYes
                                                                              Layouts that use this script
                                                                                Scripts that use this script
                                                                                  Script Definition
                                                                                  Script Steps
                                                                                  • #insert some HTML at the current cursor point
                                                                                  • Set Variable [ $r; Value:MBS( "WebView.RunJavaScript" ; "HTMLEditor"; "try { tinyMCE.get('elm1').execCommand('mceInsertContent', false, ' <b>bolded text</b> '); } catch (e) { alert(e); }" ) ]
                                                                                  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: TinyMCE

                                                                                                Used functions: