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
Tables 1
Relationships 0
Layouts 1
Scripts 2
Value Lists 0
Custom Functions 0
Custom Menus 32
File Options
Default custom menu set [Standard FileMaker Menus]
Default theme Minimalist
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
Start
2 fields defined, 0 record
Start

Fields

Table Name: Start - 2 Fields
Field Name Type Options Comments On Layouts In Relationships In Scripts In Value Lists
Image Normal, Binary Auto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
      URL 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: Start

          Regular Fields

          Field Name: Start::Image
          Field Properties Coordinates Field Format Field Behavior Quick Find
          • Top: 437 pt
          • Left: 138 pt
          • Bottom: 658 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 Properties Coordinates Field Format Field Behavior Quick Find
          • Top: 659 pt
          • Left: 138 pt
          • Bottom: 673 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

          Buttons

          Button Properties Coordinates Script/Script Step
            Type:
          • Text: Get Images
            Additional Properties:
          • Change to hand cursor over button
          • Top: 6 pt
          • Left: 5 pt
          • Bottom: 32 pt
          • Right: 169 pt
          • Anchoring: Left, Top
          Perform Script [ “GetImages” ]

          Scripts:


          Web Viewer Controls

          Web Viewer Control Properties Coordinates Web 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: 426 pt
          • Right: 788 pt
          • Anchoring: Left and Right, Top
          "http://www.monkeybreadsoftware.de/"

          Script Hierarchy

          GetImages
          Clear Images

          Next Script: [Clear Images]
          Script Name GetImages
          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
            • #Get all Image Links
            • Set Variable [ $Count; Value:MBS("WebView.GetImageCount"; "web") ]
            • Set Variable [ $Index; Value:0 ]
            • Set Variable [ $linkCount; Value:0 ]
            • Loop [ Flush: Always ]
            • 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" or Right ( $link ; 4 ) = ".png" or Right ( $link ; 4 ) = ".gif" ]
            • 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 [ Flush: Always ]
            • 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.GetResultAsContainer"; $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

                    Previous Script: [GetImages]
                    Script Name Clear Images
                    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
                        • Truncate Table [ No dialog; Table: “Start” ]
                        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: