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

MBS FileMaker Plugin Example Databases

Download Async

All examples are included with download of MBS FileMaker Plugin.

Download Async.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts5
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
OnFirstWindowOpenScript: ClearAll
OnLastWindowCloseOff
OnWindowOpenOff
OnWindowCloseOff
OnFileAVPlayerChangeOff
Thumbnail Settings
Generate ThumbnailsOn; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
Download Async
6 fields defined, 3 records
Download Async

Fields

Table Name: Download Async - 6 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
CURL HandleNormal, TextAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
  • Indexing: None
  • Automatically create indexes as needed
  • Index Language: German
      URLNormal, TextAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
      • Indexing: None
      • Automatically create indexes as needed
      • Index Language: German
          ProgressNormal, NumberAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
              ResultNormal, TextAuto-Enter:
              • Allow editing
              Validation:
              • Only during data entry
              Storage:
              • Repetitions: 1
              • Indexing: None
              • Automatically create indexes as needed
              • Index Language: German
                  OutputNormal, BinaryAuto-Enter:
                  • Allow editing
                  Validation:
                  • Only during data entry
                  Storage:
                  • Repetitions: 1
                      DebugMessagesNormal, TextAuto-Enter:
                      • Allow editing
                      Validation:
                      • Only during data entry
                      Storage:
                      • Repetitions: 1
                      • Indexing: None
                      • Automatically create indexes as needed
                      • Index Language: German

                          Layout Objects: Download Async

                          Regular Fields

                          Field Name: Download Async::CURL Handle
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 60 pt
                          • Left: 6 pt
                          • Bottom: 74 pt
                          • Right: 85 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: Download Async::URL
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 60 pt
                          • Left: 90 pt
                          • Bottom: 74 pt
                          • Right: 445 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: Download Async::Progress
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 84 pt
                          • Left: 66 pt
                          • Bottom: 98 pt
                          • Right: 145 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: Download Async::Result
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 84 pt
                          • Left: 192 pt
                          • Bottom: 98 pt
                          • Right: 445 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: Download Async::Output
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 60 pt
                          • Left: 450 pt
                          • Bottom: 185 pt
                          • Right: 703 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: Download Async::DebugMessages
                          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                          • Top: 102 pt
                          • Left: 102 pt
                          • Bottom: 182 pt
                          • Right: 445 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: Download All
                            Additional Properties:
                          • Change to hand cursor over button
                          • Rectangular
                          • Top: 6 pt
                          • Left: 18 pt
                          • Bottom: 31 pt
                          • Right: 109 pt
                          • Anchoring: Left, Top
                          Perform Script [ “DownloadAll” ]

                          Scripts:


                          Button PropertiesCoordinatesScript/Script Step
                            Type:
                          • Text: Cancel All
                            Additional Properties:
                          • Change to hand cursor over button
                          • Rectangular
                          • Top: 6 pt
                          • Left: 114 pt
                          • Bottom: 31 pt
                          • Right: 205 pt
                          • Anchoring: Left, Top
                          Perform Script [ “CancelAll” ]

                          Scripts:


                          Button PropertiesCoordinatesScript/Script Step
                            Type:
                          • Text: Clear All
                            Additional Properties:
                          • Change to hand cursor over button
                          • Rectangular
                          • Top: 6 pt
                          • Left: 210 pt
                          • Bottom: 31 pt
                          • Right: 301 pt
                          • Anchoring: Left, Top
                          Perform Script [ “ClearAll” ]

                          Scripts:


                          Script Hierarchy

                          DownloadAll
                          ClearAll
                          CancelAll
                          DownloadFinished
                          ProgressScript

                          Next Script: [ClearAll]
                          Script NameDownloadAll
                          Run script with full access privilegesOff
                          Include In MenuYes
                          Layouts that use this script
                          Scripts that use this script
                            Script Definition
                            Script Steps
                            • Go to Record/Request/Page [ First ]
                            • Loop
                            • Set Variable [ $curl; Value:MBS("CURL.New") ]
                            • Set Variable [ $r; Value:MBS("CURL.SetFinishedScript"; $curl; Get(FileName); "DownloadFinished") ]
                            • Set Variable [ $r; Value:MBS("CURL.SetProgressScript"; $curl; Get(FileName); "ProgressScript") ]
                            • Set Variable [ $r; Value:MBS("CURL.SetOptionURL"; $curl; Download Async::URL) ]
                            • Set Variable [ $r; Value:MBS("CURL.SetTag"; $curl; Get(RecordID)) ]
                            • Set Field [ Download Async::Progress; 0 ]
                            • Set Field [ Download Async::CURL Handle; $curl ]
                            • Set Variable [ $r; Value:MBS("CURL.PerformAsync"; $curl) ]
                            • If [ MBS("IsError") ]
                            • Show Custom Dialog [ Title: "CURL Error"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                            • End If
                            • Commit Records/Requests [ Skip data entry validation; No dialog ]
                            • Go to Record/Request/Page [ Next; Exit after last ]
                            • End Loop
                            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: [DownloadAll]Next Script: [CancelAll]
                                    Script NameClearAll
                                    Run script with full access privilegesOff
                                    Include In MenuYes
                                    Layouts that use this script
                                    Scripts that use this script
                                      Script Definition
                                      Script Steps
                                      • Go to Record/Request/Page [ First ]
                                      • Loop
                                      • Set Field [ Download Async::Progress; "" ]
                                      • Set Field [ Download Async::CURL Handle; "" ]
                                      • Set Field [ Download Async::DebugMessages; "" ]
                                      • Set Field [ Download Async::Output; "" ]
                                      • Commit Records/Requests [ Skip data entry validation; No dialog ]
                                      • Go to Record/Request/Page [ Next; Exit after last ]
                                      • End Loop
                                      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: [ClearAll]Next Script: [DownloadFinished]
                                              Script NameCancelAll
                                              Run script with full access privilegesOff
                                              Include In MenuYes
                                              Layouts that use this script
                                              Scripts that use this script
                                                Script Definition
                                                Script Steps
                                                • Go to Record/Request/Page [ First ]
                                                • Loop
                                                • If [ Length(Download Async::CURL Handle) > 0 ]
                                                • Set Variable [ $r; Value:MBS("CURL.Cancel"; Download Async::CURL Handle) ]
                                                • End If
                                                • Commit Records/Requests [ Skip data entry validation; No dialog ]
                                                • Go to Record/Request/Page [ Next; Exit after last ]
                                                • End Loop
                                                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: [CancelAll]Next Script: [ProgressScript]
                                                        Script NameDownloadFinished
                                                        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 [ $curl; Value:Get(ScriptParameter) ]
                                                            • Set Variable [ $errorCode; Value:MBS("CURL.ErrorCode"; $curl) ]
                                                            • Set Variable [ $httpResult; Value:MBS("CURL.GetResponseCode"; $curl) ]
                                                            • Set Variable [ $RecordID; Value:MBS("CURL.GetTag"; $curl) ]
                                                            • Go to Record/Request/Page [ $RecordID ] [ No dialog ]
                                                            • Set Field [ Download Async::Result; $errorCode ]
                                                            • Set Field [ Download Async::DebugMessages; MBS("CURL.GetDebugMessages"; $curl) ]
                                                            • If [ $errorCode = 0 and $httpResult = 200 ]
                                                            • Set Field [ Download Async::Progress; "Done" ]
                                                            • Set Field [ Download Async::Output; MBS("CURL.GetResultAsContainer"; $curl) ]
                                                            • Else
                                                            • Set Field [ Download Async::Progress; "Failed" ]
                                                            • Set Field [ Download Async::Output; "" ]
                                                            • End If
                                                            • Commit Records/Requests [ Skip data entry validation; No dialog ]
                                                            • Set Variable [ $r; Value:MBS("CURL.Release"; $curl) ]
                                                            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: [DownloadFinished]
                                                                    Script NameProgressScript
                                                                    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 [ $curl; Value:Get(ScriptParameter) ]
                                                                        • Set Variable [ $RecordID; Value:MBS("CURL.GetTag"; $curl) ]
                                                                        • Go to Record/Request/Page [ $RecordID ] [ No dialog ]
                                                                        • Set Field [ Download Async::Progress; MBS("CURL.GetProgressPercent"; $curl) ]
                                                                        • Commit Records/Requests [ Skip data entry validation; No dialog ]
                                                                        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: Download Async

                                                                                Used functions: