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
Tables 1
Relationships 0
Layouts 1
Scripts 2
Value Lists 0
Custom Functions 0
Custom Menus 24
File Options
Default custom menu set [Standard FileMaker Menus]
Default theme Minimalistisch
When opening file
Minimum allowed version 12.0
Login using Account Name; Account= Admin
Allow user to save password On
Require iOS passcode Off
Show Sign-in fields Off
Switch to layout Off
Hide all toolbars Off
Script triggers
OnFirstWindowOpen Off
OnLastWindowClose Off
OnWindowOpen Off
OnWindowClose Off
OnFileAVPlayerChange Off
OnWindowTransaction Off
Thumbnail Settings
Generate Thumbnails On; Temporary

 

Tables

Table Name
Statistics
Comments
Occurrences in Relationship Graph
Data Detector
2 fields defined, 1 record
Data Detector

Fields

Table Name: Data Detector - 2 Fields
Field Name Type Options Comments On Layouts In Relationships In Scripts In Value Lists
Input Normal, Text Auto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
  • Indexing: None
  • Automatically create indexes as needed
  • Index Language: German
      Output Normal, Text Auto-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 Properties Coordinates Field Format Field Behavior Quick 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 Properties Coordinates Field Format Field Behavior Quick 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 Properties Coordinates Script/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 Properties Coordinates Script/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 Name Detect
          Run script with full access privileges Off
          Siri Shortcut Visible Off
          Include In Menu Yes
          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 Name Show Menu
                    Run script with full access privileges Off
                    Siri Shortcut Visible Off
                    Include In Menu No
                    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: