MBS FileMaker Plugin Example Databases

Contacts

All examples are included with download of MBS FileMaker Plugin.

Contacts.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts11
Value Lists0
Custom Functions0
Custom Menus0
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
Contacts
3 fields defined, 1 record
Contacts

Fields

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

              Layout Objects: Contacts

              Regular Fields

              Field Name: Contacts::Result
              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
              • Top: 52 pt
              • Left: 8 pt
              • Bottom: 525 pt
              • Right: 526 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: Contacts::GroupID
              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
              • Top: 527 pt
              • Left: 138 pt
              • Bottom: 548 pt
              • Right: 526 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: Contacts::ContactID
              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
              • Top: 550 pt
              • Left: 138 pt
              • Bottom: 571 pt
              • Right: 526 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

              Buttons

              Button PropertiesCoordinatesScript/Script Step
                Type:
              • Text: Check Status
              • Top: 58 pt
              • Left: 539 pt
              • Bottom: 90 pt
              • Right: 687 pt
              • Anchoring: Left, Top
              Perform Script [ “Check Authorization Status” ]

              Scripts:


              Button PropertiesCoordinatesScript/Script Step
                Type:
              • Text: Request Authorization
              • Top: 58 pt
              • Left: 700 pt
              • Bottom: 90 pt
              • Right: 848 pt
              • Anchoring: Left, Top
              Perform Script [ “Request Authorization” ]

              Scripts:


              Button PropertiesCoordinatesScript/Script Step
                Type:
              • Text: Query me as JSON
              • Top: 103 pt
              • Left: 539 pt
              • Bottom: 135 pt
              • Right: 687 pt
              • Anchoring: Left, Top
              Perform Script [ “Query Me as JSON” ]

              Scripts:


              Button PropertiesCoordinatesScript/Script Step
                Type:
              • Text: List Groups
              • Top: 103 pt
              • Left: 700 pt
              • Bottom: 135 pt
              • Right: 848 pt
              • Anchoring: Left, Top
              Perform Script [ “List Groups” ]

              Scripts:


              Button PropertiesCoordinatesScript/Script Step
                Type:
              • Text: Create Group
              • Top: 148 pt
              • Left: 539 pt
              • Bottom: 180 pt
              • Right: 687 pt
              • Anchoring: Left, Top
              Perform Script [ “Create Group” ]

              Scripts:


              Button PropertiesCoordinatesScript/Script Step
                Type:
              • Text: Delete Group
              • Top: 148 pt
              • Left: 700 pt
              • Bottom: 180 pt
              • Right: 848 pt
              • Anchoring: Left, Top
              Perform Script [ “Delete Group” ]

              Scripts:


              Button PropertiesCoordinatesScript/Script Step
                Type:
              • Text: Create Contact
              • Top: 193 pt
              • Left: 539 pt
              • Bottom: 225 pt
              • Right: 687 pt
              • Anchoring: Left, Top
              Perform Script [ “Create Contact” ]

              Scripts:


              Button PropertiesCoordinatesScript/Script Step
                Type:
              • Text: Delete Contact
              • Top: 193 pt
              • Left: 700 pt
              • Bottom: 225 pt
              • Right: 848 pt
              • Anchoring: Left, Top
              Perform Script [ “Delete Contact” ]

              Scripts:


              Button PropertiesCoordinatesScript/Script Step
                Type:
              • Text: Show Contact
              • Top: 238 pt
              • Left: 539 pt
              • Bottom: 270 pt
              • Right: 687 pt
              • Anchoring: Left, Top
              Perform Script [ “Show Contact” ]

              Scripts:


              Button PropertiesCoordinatesScript/Script Step
                Type:
              • Text: Set Trigger
              • Top: 238 pt
              • Left: 700 pt
              • Bottom: 270 pt
              • Right: 848 pt
              • Anchoring: Left, Top
              Perform Script [ “Set Trigger” ]

              Scripts:


              Script Hierarchy

              Check Authorization Status
              Query Me as JSON
              List Groups
              Request Authorization
              Create Group
              Create Contact
              Show Contact
              Set Trigger
              Trigger
              Delete Group
              Delete Contact

              Next Script: [Query Me as JSON]
              Script NameCheck Authorization Status
              Run script with full access privilegesOff
              Include In MenuNo
              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: [Check Authorization Status]Next Script: [List Groups]
                              Script NameQuery Me as JSON
                              Run script with full access privilegesOff
                              Include In MenuNo
                              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: [Query Me as JSON]Next Script: [Request Authorization]
                                        Script NameList Groups
                                        Run script with full access privilegesOff
                                        Include In MenuNo
                                        Layouts that use this script
                                        Scripts that use this script
                                          Script Definition
                                          Script Steps
                                          • Set Variable [ $groups; Value:MBS( "CNContactStore.Groups" ) ]
                                          • Set Variable [ $count; Value:ValueCount ( $groups ) ]
                                          • If [ $count > 0 ]
                                          • Set Variable [ $index; Value:1 ]
                                          • Set Variable [ $text; Value:"" ]
                                          • Loop
                                          • Set Variable [ $groupID; Value:GetValue($groups; $index) ]
                                          • Set Variable [ $groupName; Value:MBS( "CNGroup.Name"; $groupID ) ]
                                          • Set Variable [ $text; Value:$text & $GroupName & " " & $groupID ]
                                          • #next
                                          • Set Variable [ $index; Value:$index + 1 ]
                                          • Exit Loop If [ $index > $count ]
                                          • Set Variable [ $text; Value:$text & ¶ ]
                                          • End Loop
                                          • End If
                                          • Set Field [ Contacts::Result; $text ]
                                          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: [List Groups]Next Script: [Create Group]
                                                  Script NameRequest Authorization
                                                  Run script with full access privilegesOff
                                                  Include In MenuNo
                                                  Layouts that use this script
                                                  Scripts that use this script
                                                    Script Definition
                                                    Script Steps
                                                    • Set Variable [ $r; Value:MBS( "CNContactStore.RequestAccesss" ) ]
                                                    • Pause/Resume Script [ Duration (seconds): 1 ]
                                                    • Set Variable [ $r; Value:MBS( "CNContactStore.AuthorizationError" ) ]
                                                    • If [ Length($r) > 0 ]
                                                    • Show Custom Dialog [ Title: "Error"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                    • End If
                                                    • Set Variable [ $groups; Value:MBS( "CNContactStore.Groups" ) ]
                                                    • If [ Length ( $groups ) = 0 ]
                                                    • Show Custom Dialog [ Title: "Possible Problem"; Message: "Either you have no groups or you did not code sign the app?"; Default Button: “OK”, Commit: “Yes” ]
                                                    • 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: [Request Authorization]Next Script: [Create Contact]
                                                                  Script NameCreate Group
                                                                  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( "CNContactStore.AddGroup"; "Test Group") ]
                                                                    • If [ MBS("IsError") ]
                                                                    • Show Custom Dialog [ Title: "Failed to create a group"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                    • Else
                                                                    • Set Field [ Contacts::GroupID; $r ]
                                                                    • 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: [Create Group]Next Script: [Show Contact]
                                                                            Script NameCreate Contact
                                                                            Run script with full access privilegesOff
                                                                            Include In MenuNo
                                                                            Layouts that use this script
                                                                            Scripts that use this script
                                                                              Script Definition
                                                                              Script Steps
                                                                              • Set Variable [ $contactID; Value:MBS( "CNContactStore.NewContact") ]
                                                                              • Set Variable [ $r; Value:MBS( "CNContact.SetValue"; $contactID; "givenName"; "Joe" ) ]
                                                                              • Set Variable [ $r; Value:MBS( "CNContact.SetValue"; $contactID; "familyName"; "Miller" ) ]
                                                                              • Set Variable [ $r; Value:MBS( "CNContact.SetValue"; $contactID; "jobTitle"; "Family Manager" ) ]
                                                                              • Set Variable [ $r; Value:MBS( "CNContact.SetValue"; $contactID; "organization"; "Family" ) ]
                                                                              • Set Variable [ $image; Value:MBS( "Container.ReadFile"; "/Library/Desktop Pictures/Lion.jpg") ]
                                                                              • Set Variable [ $r; Value:MBS( "CNContact.SetValue"; $contactID; "imageData"; $image ) ]
                                                                              • Set Variable [ $r; Value:MBS( "CNContact.AddEmailAddress"; $contactID; "test@test.test"; "Work" ) ]
                                                                              • Set Variable [ $r; Value:MBS( "CNContact.AddInstantMessage"; $contactID; "instantTest"; "Facebook"; "Work" ) ]
                                                                              • Set Variable [ $r; Value:MBS( "CNContact.AddURLAddress"; $contactID; "http://www.monkeybreadsoftware.com/"; "Homepage" ) ]
                                                                              • Set Variable [ $r; Value:MBS( "CNContact.AddSocialProfile"; $contactID; "Home"; "http://www.facebook.com"; "testSocial"; ""; "Facebook" ) ]
                                                                              • Set Variable [ $r; Value:MBS( "CNContact.AddRelation"; $contactID; "Jane Miller"; "Sister" ) ]
                                                                              • Set Variable [ $r; Value:MBS( "CNContact.AddPhoneNumber"; $contactID; "123 456 789"; "iPhone" ) ]
                                                                              • Set Variable [ $r; Value:MBS( "CNContact.AddPostalAddress"; $contactID; "Home"; "Main Street 123"; "New City"; "NS"; "12345"; "USA"; "US" ) ]
                                                                              • Set Variable [ $contactID; Value:MBS( "CNContactStore.AddContact"; $contactID) ]
                                                                              • If [ MBS("IsError") ]
                                                                              • Show Custom Dialog [ Title: "Failed to create a contact"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                              • Else
                                                                              • Set Field [ Contacts::ContactID; $contactID ]
                                                                              • Set Variable [ $json; Value:MBS( "CNContact.JSON"; $contactID) ]
                                                                              • Set Variable [ $json; Value:MBS("JSON.Colorize"; MBS( "JSON.Format"; $json) ) ]
                                                                              • Set Field [ Contacts::Result; $json ]
                                                                              • 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: [Create Contact]Next Script: [Set Trigger]
                                                                                      Script NameShow Contact
                                                                                      Run script with full access privilegesOff
                                                                                      Include In MenuNo
                                                                                      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: [Show Contact]Next Script: [Trigger]
                                                                                                Script NameSet Trigger
                                                                                                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: [Set Trigger]Next Script: [Delete Group]
                                                                                                                Script NameTrigger
                                                                                                                Run script with full access privilegesOff
                                                                                                                Include In MenuNo
                                                                                                                Layouts that use this script
                                                                                                                  Scripts that use this script
                                                                                                                    Script Definition
                                                                                                                    Script Steps
                                                                                                                    • Show Custom Dialog [ Title: "Changes"; Message: "Someone made changes in other application..."; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                                                                    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: [Trigger]Next Script: [Delete Contact]
                                                                                                                                  Script NameDelete Group
                                                                                                                                  Run script with full access privilegesOff
                                                                                                                                  Include In MenuNo
                                                                                                                                  Layouts that use this script
                                                                                                                                  Scripts that use this script
                                                                                                                                    Script Definition
                                                                                                                                    Script Steps
                                                                                                                                    • If [ Length ( Contacts::GroupID ) = 0 ]
                                                                                                                                    • Show Custom Dialog [ Title: "Failed to delete a group"; Message: "No ID in field"; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                                                                                    • Else
                                                                                                                                    • Set Variable [ $r; Value:MBS( "CNContactStore.DeleteGroup"; Contacts::GroupID) ]
                                                                                                                                    • If [ MBS("IsError") ]
                                                                                                                                    • Show Custom Dialog [ Title: "Failed to delete a group"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                                                                                    • Else
                                                                                                                                    • Set Field [ Contacts::GroupID; "" ]
                                                                                                                                    • End If
                                                                                                                                    • 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: [Delete Group]
                                                                                                                                            Script NameDelete Contact
                                                                                                                                            Run script with full access privilegesOff
                                                                                                                                            Include In MenuNo
                                                                                                                                            Layouts that use this script
                                                                                                                                            Scripts that use this script
                                                                                                                                              Script Definition
                                                                                                                                              Script Steps
                                                                                                                                              • If [ Length ( Contacts::ContactID ) = 0 ]
                                                                                                                                              • Show Custom Dialog [ Title: "Failed to delete a contact"; Message: "No ID in field"; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                                                                                              • Else
                                                                                                                                              • Set Variable [ $r; Value:MBS( "CNContactStore.DeleteContact"; Contacts::ContactID) ]
                                                                                                                                              • If [ MBS("IsError") ]
                                                                                                                                              • Show Custom Dialog [ Title: "Failed to delete a contact"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Abbrechen”, Commit: “No” ]
                                                                                                                                              • Else
                                                                                                                                              • Set Field [ Contacts::ContactID; "" ]
                                                                                                                                              • End If
                                                                                                                                              • 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

                                                                                                                                                      Download example: Contacts

                                                                                                                                                      Used functions:




                                                                                                                                                      Links
                                                                                                                                                      MBS Xojo Plugins