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

MBS FileMaker Plugin Example Databases

Data Detector

All examples are included with download of MBS FileMaker Plugin.

Data Detector.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts2
Value Lists0
Custom Functions0
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
Data Detector
2 fields defined, 1 record
Data Detector

Fields

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

          Layout Objects: Data Detector

          Regular Fields

          Field Name: Data Detector::Input
          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
          • Top: 60 pt
          • Left: 138 pt
          • Bottom: 290 pt
          • Right: 969 pt
          • Anchoring: Left and Right, 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: Data Detector::Output
          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
          • Top: 301 pt
          • Left: 138 pt
          • Bottom: 701 pt
          • Right: 969 pt
          • Anchoring: Left and Right, 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: Run Data Detectors
          • Top: 21 pt
          • Left: 689 pt
          • Bottom: 49 pt
          • Right: 823 pt
          • Anchoring: Left, Top
          Perform Script [ “Detect” ]

          Scripts:


          Button PropertiesCoordinatesScript/Script Step
            Type:
          • Text: Action Menu
          • Top: 21 pt
          • Left: 835 pt
          • Bottom: 49 pt
          • Right: 969 pt
          • Anchoring: Left, Top
          Perform Script [ “Show Menu” ]

          Scripts:


          Script Hierarchy

          Detect
          Show Menu

          Next Script: [Show Menu]
          Script NameDetect
          Run script with full access privilegesOff
          Siri Shortcut VisibleOff
          Include In MenuYes
          Layouts that use this script
          Scripts that use this script
            Script Definition
            Script Steps
            • Set Field [ Data Detector::Output; MBS( "RegEx.DataDetector"; "Date, Address, Link, PhoneNumber, TransitInformation "; Data Detector::Input) ]
            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: [Detect]
                    Script NameShow Menu
                    Run script with full access privilegesOff
                    Siri Shortcut VisibleOff
                    Include In MenuNo
                    Layouts that use this script
                    Scripts that use this script
                      Script Definition
                      Script Steps
                      • Set Variable [ $json; Value:MBS( "RegEx.DataDetector"; "Date, Address, Link, PhoneNumber, TransitInformation "; Data Detector::Input) ]
                      • #did we find something?
                      • Set Variable [ $count; Value:MBS("JSON.GetArraySize"; $json) ]
                      • If [ $count = 0 ]
                      • Exit Script [ ]
                      • End If
                      • Set Variable [ $menu; Value:MBS("Menu.CreateMenu") ]
                      • Set Variable [ $index; Value:0 ]
                      • Loop [ Flush: Defer ]
                      • #check entry
                      • Set Variable [ $entry; Value:MBS("JSON.GetArrayItem"; $json; $index; 0) ]
                      • Set Variable [ $type; Value:MBS("JSON.GetPathItem"; $entry; "type"; 3) ]
                      • If [ $type = "PhoneNumber" ]
                      • Set Variable [ $PhoneNumber; Value:MBS("JSON.GetPathItem"; $entry; "PhoneNumber"; 3) ]
                      • Set Variable [ $Text; Value:Substitute($PhoneNumber; "\\"; "\\\\") ]
                      • Set Variable [ $Text; Value:Substitute($Text; "\""; "\\\"") ]
                      • Set Variable [ $Text; Value:Substitute($Text; ¶; "\¶") ]
                      • Set Variable [ $item; Value:MBS("MenuItem.CreateMenuItem"; "Copy phone number " & $phoneNumber) ]
                      • Set Variable [ $r; Value:MBS( "MenuItem.SetEvaluate"; $item; "MBS( \"Clipboard.SetText\"; \"" & $Text & "\" )" ) ]
                      • Set Variable [ $r; Value:MBS("Menu.AddItem"; $menu; $item) ]
                      • Set Variable [ $URL; Value:"tel:" & GetAsURLEncoded ( Trim($Text) ) ]
                      • Set Variable [ $item; Value:MBS("MenuItem.CreateMenuItem"; "Call phone number " & $phoneNumber) ]
                      • Set Variable [ $r; Value:MBS( "MenuItem.SetEvaluate"; $item; "MBS( \"ShowURL\"; \"" & $URL & "\" )" ) ]
                      • Set Variable [ $r; Value:MBS("Menu.AddItem"; $menu; $item) ]
                      • Else If [ $type = "Date" ]
                      • Set Variable [ $Text; Value:MBS("JSON.GetPathItem"; $entry; "Text"; 3) ]
                      • Set Variable [ $Text; Value:Substitute($Text; "\\"; "\\\\") ]
                      • Set Variable [ $Text; Value:Substitute($Text; "\""; "\\\"") ]
                      • Set Variable [ $Text; Value:Substitute($Text; ¶; "\¶") ]
                      • Set Variable [ $item; Value:MBS("MenuItem.CreateMenuItem"; "Copy date " & $text) ]
                      • Set Variable [ $r; Value:MBS( "MenuItem.SetEvaluate"; $item; "MBS( \"Clipboard.SetText\"; \"" & $Text & "\" )" ) ]
                      • Set Variable [ $r; Value:MBS("Menu.AddItem"; $menu; $item) ]
                      • Else If [ $type = "TransitInformation" ]
                      • Set Variable [ $Text; Value:MBS("JSON.GetPathItem"; $entry; "Text"; 3) ]
                      • Set Variable [ $Text; Value:Substitute($Text; "\\"; "\\\\") ]
                      • Set Variable [ $Text; Value:Substitute($Text; "\""; "\\\"") ]
                      • Set Variable [ $Text; Value:Substitute($Text; ¶; "\¶") ]
                      • Set Variable [ $item; Value:MBS("MenuItem.CreateMenuItem"; "Copy transit information " & $text) ]
                      • Set Variable [ $r; Value:MBS( "MenuItem.SetEvaluate"; $item; "MBS( \"Clipboard.SetText\"; \"" & $Text & "\" )" ) ]
                      • Set Variable [ $r; Value:MBS("Menu.AddItem"; $menu; $item) ]
                      • Set Variable [ $URL; Value:"https://www.google.de/search?q=" & GetAsURLEncoded ( Trim($Text) ) ]
                      • Set Variable [ $item; Value:MBS("MenuItem.CreateMenuItem"; "Search for " & $text & " with Google") ]
                      • Set Variable [ $r; Value:MBS( "MenuItem.SetEvaluate"; $item; "MBS( \"ShowURL\"; \"" & $URL & "\" )" ) ]
                      • Set Variable [ $r; Value:MBS("Menu.AddItem"; $menu; $item) ]
                      • Else If [ $type = "Address" ]
                      • Set Variable [ $Text; Value:MBS("JSON.GetPathItem"; $entry; "Text"; 3) ]
                      • Set Variable [ $Text; Value:Substitute($Text; "\\"; "\\\\") ]
                      • Set Variable [ $Text; Value:Substitute($Text; "\""; "\\\"") ]
                      • Set Variable [ $OneLineText; Value:Substitute($Text; ¶; ", ") ]
                      • Set Variable [ $Text; Value:Substitute($Text; ¶; "\¶") ]
                      • Set Variable [ $URL; Value:GetAsURLEncoded ( Trim($Text) ) ]
                      • Set Variable [ $item; Value:MBS("MenuItem.CreateMenuItem"; "Copy address " & $OneLineText) ]
                      • Set Variable [ $r; Value:MBS( "MenuItem.SetEvaluate"; $item; "MBS( \"Clipboard.SetText\"; \"" & $Text & "\" )" ) ]
                      • Set Variable [ $r; Value:MBS("Menu.AddItem"; $menu; $item) ]
                      • Set Variable [ $item; Value:MBS("MenuItem.CreateMenuItem"; "Open Apple Maps for " & $OneLineText) ]
                      • Set Variable [ $r; Value:MBS( "MenuItem.SetEvaluate"; $item; "MBS( \"ShowURL\"; \"https://maps.apple.com/?q=" & $URL & "\" )" ) ]
                      • Set Variable [ $r; Value:MBS("Menu.AddItem"; $menu; $item) ]
                      • Set Variable [ $item; Value:MBS("MenuItem.CreateMenuItem"; "Open Google Maps for " & $OneLineText) ]
                      • Set Variable [ $r; Value:MBS( "MenuItem.SetEvaluate"; $item; "MBS( \"ShowURL\"; \"https://www.google.com/maps/search/?api=1&query=" & $URL & "\" )" ) ]
                      • Set Variable [ $r; Value:MBS("Menu.AddItem"; $menu; $item) ]
                      • Else If [ $type = "Link" ]
                      • Set Variable [ $Text; Value:MBS("JSON.GetPathItem"; $entry; "URL"; 3) ]
                      • Set Variable [ $Text; Value:Substitute($Text; "\\"; "\\\\") ]
                      • Set Variable [ $Text; Value:Substitute($Text; "\""; "\\\"") ]
                      • Set Variable [ $Text; Value:Substitute($Text; ¶; "") ]
                      • Set Variable [ $Text; Value:Trim($text) ]
                      • If [ Left ( $Text; 7 ) = "mailto:" ]
                      • Set Variable [ $email; Value:Middle ( $text ; 8; Length ( $Text )) ]
                      • Set Variable [ $item; Value:MBS("MenuItem.CreateMenuItem"; "Copy email " & $email) ]
                      • Set Variable [ $r; Value:MBS( "MenuItem.SetEvaluate"; $item; "MBS( \"Clipboard.SetText\"; \"" & $Text & "\" )" ) ]
                      • Set Variable [ $r; Value:MBS("Menu.AddItem"; $menu; $item) ]
                      • Set Variable [ $item; Value:MBS("MenuItem.CreateMenuItem"; "New email to " & $email) ]
                      • Set Variable [ $r; Value:MBS( "MenuItem.SetEvaluate"; $item; "MBS( \"ShowURL\"; \"" & $Text & "\" )" ) ]
                      • Set Variable [ $r; Value:MBS("Menu.AddItem"; $menu; $item) ]
                      • Else
                      • Set Variable [ $item; Value:MBS("MenuItem.CreateMenuItem"; "Copy URL " & $Text) ]
                      • Set Variable [ $r; Value:MBS( "MenuItem.SetEvaluate"; $item; "MBS( \"Clipboard.SetText\"; \"" & $Text & "\" )" ) ]
                      • Set Variable [ $r; Value:MBS("Menu.AddItem"; $menu; $item) ]
                      • Set Variable [ $item; Value:MBS("MenuItem.CreateMenuItem"; "Open URL " & $Text) ]
                      • Set Variable [ $r; Value:MBS( "MenuItem.SetEvaluate"; $item; "MBS( \"ShowURL\"; \"" & $Text & "\" )" ) ]
                      • Set Variable [ $r; Value:MBS("Menu.AddItem"; $menu; $item) ]
                      • End If
                      • End If
                      • Set Variable [ $item; Value:MBS("MenuItem.CreateSeparator") ]
                      • Set Variable [ $r; Value:MBS("Menu.AddItem"; $menu; $item) ]
                      • #next
                      • Set Variable [ $index; Value:$index + 1 ]
                      • Exit Loop If [ $index ≥ $count ]
                      • End Loop
                      • Set Variable [ $m; Value:MBS("Menu.PopUp"; $Menu; "mouse") ]
                      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: Data Detector

                              Used functions: