MBS FileMaker Plugin Example Databases

TinyURL

All examples are included with download of MBS FileMaker Plugin.

TinyURL.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts1
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
OnFirstWindowOpenOff
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
TinyURL
7 fields defined, 1 record
TinyURL

Fields

Table Name: TinyURL - 7 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
APIKeyNormal, TextAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Global
  • Repetitions: 1
  • Index Language: German
      Long URLNormal, TextAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
      • Indexing: None
      • Automatically create indexes as needed
      • Index Language: German
          Short URLNormal, TextAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
              ProviderNormal, TextAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Repetitions: 1
              • Indexing: None
              • Automatically create indexes as needed
              • Index Language: German
                  ResultTextNormal, TextAuto-Enter:
                  • Allow editing
                  Validation:
                  • Only during data entry
                  Storage:
                  • Repetitions: 1
                  • Indexing: None
                  • Automatically create indexes as needed
                  • Index Language: German
                      ResultCodeNormal, TextAuto-Enter:
                      • Allow editing
                      Validation:
                      • Only during data entry
                      Storage:
                      • Repetitions: 1
                      • Indexing: None
                      • Automatically create indexes as needed
                      • Index Language: German
                          DebugTextNormal, TextAuto-Enter:
                          • Allow editing
                          Validation:
                          • Only during data entry
                          Storage:
                          • Repetitions: 1
                          • Indexing: None
                          • Automatically create indexes as needed
                          • Index Language: German

                              Layout Objects: TinyURL

                              Regular Fields

                              Field Name: TinyURL::APIKey
                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                              • Top: 48 pt
                              • Left: 138 pt
                              • Bottom: 62 pt
                              • Right: 493 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: TinyURL::Long URL
                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                              • Top: 66 pt
                              • Left: 138 pt
                              • Bottom: 80 pt
                              • Right: 493 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: TinyURL::Short URL
                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                              • Top: 132 pt
                              • Left: 138 pt
                              • Bottom: 146 pt
                              • Right: 493 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: TinyURL::Provider
                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                              • Top: 84 pt
                              • Left: 138 pt
                              • Bottom: 98 pt
                              • Right: 493 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: TinyURL::ResultText
                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                              • Top: 186 pt
                              • Left: 138 pt
                              • Bottom: 272 pt
                              • Right: 481 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: TinyURL::ResultCode
                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                              • Top: 168 pt
                              • Left: 138 pt
                              • Bottom: 182 pt
                              • Right: 391 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: TinyURL::DebugText
                              Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                              • Top: 276 pt
                              • Left: 138 pt
                              • Bottom: 374 pt
                              • Right: 481 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

                              Group Buttons

                              Button PropertiesCoordinatesScript/Script Step
                                Type:
                              • Text: Get Short URL
                                Additional Properties:
                              • Change to hand cursor over button
                              • Rectangular
                              • Top: 102 pt
                              • Left: 378 pt
                              • Bottom: 127 pt
                              • Right: 469 pt
                              • Anchoring: Left, Top
                              Perform Script [ “Run” ]

                              Scripts:


                              Button PropertiesCoordinatesScript/Script Step
                                Type:
                              • Text: Request API Key
                                Additional Properties:
                              • Change to hand cursor over button
                              • Rectangular
                              • Top: 54 pt
                              • Left: 528 pt
                              • Bottom: 79 pt
                              • Right: 643 pt
                              • Anchoring: Left, Top
                              Open URL [ "http://tiny-url.info/request_api_key.html" ] [ No dialog ]

                              Script Hierarchy

                              Run

                              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
                                • #Setup transfer
                                • Set Variable [ $r; Value:MBS("Trace") ]
                                • Set Variable [ $curl; Value:MBS("CURL.New") ]
                                • Set Variable [ $result; Value:MBS("CURL.SetOptionPost"; $curl; 1) ]
                                • Set Variable [ $result; Value:MBS("CURL.SetOptionVerbose"; $curl; 1) ]
                                • Set Variable [ $result; Value:MBS("CURL.SetOptionURL"; $curl; "http://tiny-url.info/api/v1/create") ]
                                • Set Variable [ $result; Value:MBS("CURL.SetOptionHTTPHeader"; $curl; "Content-Type: multipart/form-data; charset=utf-8"; "Expect:"; "Transfer-Encoding:") ]
                                • Set Variable [ $result; Value:MBS( "CURL.FormAddKeyValue"; $curl; "format"; "json" ) ]
                                • Set Variable [ $result; Value:MBS( "CURL.FormAddKeyValue"; $curl; "apikey"; TinyURL::APIKey ) ]
                                • Set Variable [ $result; Value:MBS( "CURL.FormAddKeyValue"; $curl; "url"; TinyURL::Long URL ) ]
                                • Set Variable [ $result; Value:MBS( "CURL.FormAddKeyValue"; $curl; "provider"; TinyURL::Provider ) ]
                                • Set Variable [ $result; Value:MBS( "CURL.FormFinish"; $curl) ]
                                • #Run transfer
                                • Set Field [ TinyURL::ResultCode; MBS("CURL.Perform"; $curl) ]
                                • #Check result
                                • Set Field [ TinyURL::DebugText; MBS("String.ReplaceNewline"; MBS("CURL.GetDebugAsText"; $curl);1) ]
                                • Set Variable [ $result; Value:MBS("String.ReplaceNewline"; MBS("CURL.GetResultAsText"; $curl);1) ]
                                • Set Field [ TinyURL::ResultText; $result ]
                                • Set Variable [ $r; Value:MBS("CURL.Cleanup"; $curl) ]
                                • Set Variable [ $stateJSON; Value:MBS("JSON.GetObjectItem"; $result; "state") ]
                                • Set Variable [ $state; Value:MBS("JSON.GetStringValue"; $stateJSON) ]
                                • If [ $state = "OK" ]
                                • Set Variable [ $urlJSON; Value:MBS("JSON.GetObjectItem"; $result; "shorturl") ]
                                • Set Variable [ $url; Value:MBS("JSON.GetStringValue"; $urlJSON) ]
                                • Set Field [ TinyURL::Short URL; $url ]
                                • Else
                                • Show Custom Dialog [ Title: "Error"; Message: $state; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                                • 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: TinyURL

                                        Used functions:




                                        Links
                                        MBS Xojo PDF Plugins