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

MBS FileMaker Plugin Example Databases

WebViewer Download Images with CURL

All examples are included with download of MBS FileMaker Plugin.

WebViewer Download Images with CURL.fmp12

Overview
Tables1
Relationships0
Layouts2
Scripts1
Value Lists0
Custom Functions0
Custom Menus32
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
Start
2 fields defined, 0 record
Start

Fields

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

          Layout Objects: Start

          Regular Fields

          Field Name: Start::Image
          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
          • Top: 546 pt
          • Left: 138 pt
          • Bottom: 767 pt
          • Right: 553 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: Start::URL
          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
          • Top: 768 pt
          • Left: 138 pt
          • Bottom: 782 pt
          • Right: 553 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 Images
            Additional Properties:
          • Change to hand cursor over button
          • Rectangular
          • Top: 6 pt
          • Left: 6 pt
          • Bottom: 31 pt
          • Right: 157 pt
          • Anchoring: Left, Top
          Perform Script [ “GetImages” ]

          Scripts:


          Web Viewer Controls

          Web Viewer Control PropertiesCoordinatesWeb Address
            Object Name:
          • web
            Additional Properties:
          • Allow interaction with web viewer content
          • Display progress bar
          • Display status messages
          • Automatically encode URL
          • Top: 36 pt
          • Left: 6 pt
          • Bottom: 535 pt
          • Right: 793 pt
          • Anchoring: Left, Top
          "http://www.monkeybreadsoftware.de/"

          Layout Objects: Links

          Regular Fields

          Field Name: <Missing Field>
          Field PropertiesCoordinatesField FormatField BehaviorQuick Find
          • Top: 18 pt
          • Left: 30 pt
          • Bottom: 32 pt
          • Right: 553 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

          Script Hierarchy

          GetImages

          Script NameGetImages
          Run script with full access privilegesOff
          Include In MenuYes
          Layouts that use this script
          Scripts that use this script
            Script Definition
            Script Steps
            • #Get all Image Links
            • Set Variable [ $Count; Value:MBS("WebView.GetImageCount"; "web") ]
            • Set Variable [ $Index; Value:0 ]
            • Set Variable [ $linkCount; Value:0 ]
            • Loop
            • Exit Loop If [ $Index ≥ $Count ]
            • Set Variable [ $link; Value:MBS("WebView.GetImage"; "web"; $Index; "src") ]
            • #We store links in variables. For the plugin, we use index as variable name.
            • If [ Right ( $link ; 4 ) = ".jpg" ]
            • Set Variable [ $result; Value:MBS( "FM.VariableSet" ; $linkCount; $link ) ]
            • Set Variable [ $linkCount; Value:$linkCount+1 ]
            • End If
            • Set Variable [ $Index; Value:$Index+1 ]
            • End Loop
            • #Download them
            • Set Variable [ $Index; Value:0 ]
            • Delete All Records [ No dialog ]
            • Set Variable [ $curl; Value:MBS("CURL.New") ]
            • Loop
            • Exit Loop If [ $Index ≥ $linkCount ]
            • Set Variable [ $link; Value:MBS("FM.VariableGet"; $Index) ]
            • New Record/Request
            • Set Field [ Start::URL; $link ]
            • Set Variable [ $result; Value:MBS("CURL.SetOptionURL"; $curl; $link) ]
            • Set Variable [ $result; Value:MBS("CURL.Perform"; $curl) ]
            • Set Field [ Start::Image; MBS("CURL.GetResultAsJPEG"; $curl) ]
            • Commit Records/Requests
            • Set Variable [ $Index; Value:$Index+1 ]
            • End Loop
            • Set Variable [ $result; Value:MBS("CURL.Cleanup"; $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

                    Download example: WebViewer Download Images with CURL

                    Used functions: