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

MBS FileMaker Plugin Example Databases

Archives

All examples are included with download of MBS FileMaker Plugin.

Archives.fmp12

Overview
Tables 1
Relationships 0
Layouts 2
Scripts 3
Value Lists 0
Custom Functions 0
Custom Menus 24
File Options
Default custom menu set [Standard FileMaker Menus]
Default theme Apex Blue
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 On
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
Archives
13 fields defined, 0 record
Archives

Fields

Table Name: Archives - 13 Fields
Field Name Type Options Comments On Layouts In Relationships In Scripts In Value Lists
PrimaryKey Normal, Text Auto-Enter:
  • Context table: Archives
    Calculation: Get( UUID )
Validation:
  • Only during data entry
  • Not empty
  • Unique
  • Strict validation
Storage:
  • Repetitions: 1
  • Indexing: Minimal
  • Automatically create indexes as needed
  • Index Language: Unicode Raw
Unique identifier of each record in this table
          CreationTimestamp Normal, Timestamp Auto-Enter:
          • Creation timestamp
          Validation:
          • Only during data entry
          • Strict data type: 4 digit year
          • Not empty
          • Strict validation
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German
          Date and time each record was created
                  CreatedBy Normal, Text Auto-Enter:
                  • Creation account name
                  Validation:
                  • Only during data entry
                  • Not empty
                  • Strict validation
                  Storage:
                  • Repetitions: 1
                  • Indexing: None
                  • Automatically create indexes as needed
                  • Index Language: German
                  Account name of the user who created each record
                          ModificationTimestamp Normal, Timestamp Auto-Enter:
                          • Modification timestamp
                          Validation:
                          • Only during data entry
                          • Strict data type: 4 digit year
                          • Not empty
                          • Strict validation
                          Storage:
                          • Repetitions: 1
                          • Indexing: None
                          • Automatically create indexes as needed
                          • Index Language: German
                          Date and time each record was last modified
                                  ModifiedBy Normal, Text Auto-Enter:
                                  • Modification account name
                                  Validation:
                                  • Only during data entry
                                  • Not empty
                                  • Strict validation
                                  Storage:
                                  • Repetitions: 1
                                  • Indexing: None
                                  • Automatically create indexes as needed
                                  • Index Language: German
                                  Account name of the user who last modified each record
                                          PathName Normal, Text Auto-Enter:
                                          • Allow editing
                                          Validation:
                                          • Only during data entry
                                          Storage:
                                          • Repetitions: 1
                                          • Indexing: None
                                          • Automatically create indexes as needed
                                          • Index Language: German
                                              ModificationTime Normal, Timestamp Auto-Enter:
                                              • Allow editing
                                              Validation:
                                              • Only during data entry
                                              Storage:
                                              • Repetitions: 1
                                              • Indexing: None
                                              • Automatically create indexes as needed
                                              • Index Language: German
                                                  Size Normal, Number Auto-Enter:
                                                  • Allow editing
                                                  Validation:
                                                  • Only during data entry
                                                  Storage:
                                                  • Repetitions: 1
                                                  • Indexing: None
                                                  • Automatically create indexes as needed
                                                  • Index Language: German
                                                      FileType Normal, Text Auto-Enter:
                                                      • Allow editing
                                                      Validation:
                                                      • Only during data entry
                                                      Storage:
                                                      • Repetitions: 1
                                                      • Indexing: None
                                                      • Automatically create indexes as needed
                                                      • Index Language: German
                                                          Encrypted Normal, Number Auto-Enter:
                                                          • Allow editing
                                                          Validation:
                                                          • Only during data entry
                                                          Storage:
                                                          • Repetitions: 1
                                                          • Indexing: None
                                                          • Automatically create indexes as needed
                                                          • Index Language: German
                                                              JSON Normal, Text Auto-Enter:
                                                              • Allow editing
                                                              Validation:
                                                              • Only during data entry
                                                              Storage:
                                                              • Repetitions: 1
                                                              • Indexing: None
                                                              • Automatically create indexes as needed
                                                              • Index Language: German
                                                                  Image Normal, Binary Auto-Enter:
                                                                  • Allow editing
                                                                  Validation:
                                                                  • Only during data entry
                                                                  Storage:
                                                                  • Global
                                                                  • Repetitions: 1
                                                                      Export Normal, Binary Auto-Enter:
                                                                      • Allow editing
                                                                      Validation:
                                                                      • Only during data entry
                                                                      Storage:
                                                                      • Global
                                                                      • Repetitions: 1

                                                                          Layout Objects: Archives

                                                                          Regular Fields

                                                                          Field Name: Archives::PathName
                                                                          Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                          • Top: 164 pt
                                                                          • Left: 6 pt
                                                                          • Bottom: 195 pt
                                                                          • Right: 275 pt
                                                                          • Anchoring: Left and Right, 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: Archives::ModificationTime
                                                                          Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                          • Top: 164 pt
                                                                          • Left: 368 pt
                                                                          • Bottom: 195 pt
                                                                          • Right: 609 pt
                                                                          • Anchoring: Right, 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: Archives::Size
                                                                          Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                          • Top: 164 pt
                                                                          • Left: 613 pt
                                                                          • Bottom: 195 pt
                                                                          • Right: 732 pt
                                                                          • Anchoring: Right, 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: Archives::FileType
                                                                          Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                          • Top: 164 pt
                                                                          • Left: 736 pt
                                                                          • Bottom: 195 pt
                                                                          • Right: 855 pt
                                                                          • Anchoring: Right, 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: Archives::Encrypted
                                                                          Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                          • Top: 164 pt
                                                                          • Left: 859 pt
                                                                          • Bottom: 195 pt
                                                                          • Right: 943 pt
                                                                          • Anchoring: Right, 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: Archives::JSON
                                                                          Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                          • Top: 33 pt
                                                                          • Left: 630 pt
                                                                          • Bottom: 427 pt
                                                                          • Right: 929 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: Archives::Image
                                                                          Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                          • Top: 7 pt
                                                                          • Left: 925 pt
                                                                          • Bottom: 82 pt
                                                                          • Right: 1009 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
                                                                          No

                                                                          Buttons

                                                                          Button Properties Coordinates Script/Script Step
                                                                            Type:
                                                                          • Text: Open Archive
                                                                            Additional Properties:
                                                                          • Change to hand cursor over button
                                                                          • Top: 23 pt
                                                                          • Left: 17 pt
                                                                          • Bottom: 54 pt
                                                                          • Right: 161 pt
                                                                          • Anchoring: Left, Top
                                                                          Perform Script [ “List Archive” ]

                                                                          Scripts:


                                                                          Button Properties Coordinates Script/Script Step
                                                                            Type:
                                                                          • Text: Export
                                                                            Additional Properties:
                                                                          • Change to hand cursor over button
                                                                          • Top: 164 pt
                                                                          • Left: 280 pt
                                                                          • Bottom: 194 pt
                                                                          • Right: 364 pt
                                                                          • Anchoring: Right, Top
                                                                          Perform Script [ “Export Selected” ]

                                                                          Scripts:


                                                                          Button Properties Coordinates Script/Script Step
                                                                            Type:
                                                                          • Text: Create Archive
                                                                            Additional Properties:
                                                                          • Change to hand cursor over button
                                                                          • Top: 23 pt
                                                                          • Left: 179 pt
                                                                          • Bottom: 54 pt
                                                                          • Right: 323 pt
                                                                          • Anchoring: Left, Top
                                                                          Perform Script [ “Create Archive” ]

                                                                          Scripts:


                                                                          Popover Buttons

                                                                          Popover Button Properties Coordinates
                                                                            Type:
                                                                          • Text: JSON
                                                                          • Top: 164 pt
                                                                          • Left: 953 pt
                                                                          • Bottom: 195 pt
                                                                          • Right: 1016 pt
                                                                          • Anchoring: Right, Top
                                                                          Popover Properties Coordinates
                                                                            Show Title Bar:
                                                                          • Yes
                                                                            Title:
                                                                          • "Details"
                                                                            Position:
                                                                          • Left
                                                                          • Top: 5 pt
                                                                          • Left: 612 pt
                                                                          • Bottom: 442 pt
                                                                          • Right: 942 pt
                                                                          • Anchoring: Left, Top
                                                                          Popover Content
                                                                          Tab Controls Slide Controls Fields Buttons Portals Web Viewer Controls Charts
                                                                              Field Objects

                                                                              Layout Objects: Card

                                                                              Regular Fields

                                                                              Field Name: Archives::Export
                                                                              Field Properties Coordinates Field Format Field Behavior Quick Find
                                                                              • Top: 9 pt
                                                                              • Left: 12 pt
                                                                              • Bottom: 253 pt
                                                                              • Right: 391 pt
                                                                              • Anchoring: Left and Right, Top and Bottom
                                                                              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
                                                                              No

                                                                              Buttons

                                                                              Button Properties Coordinates Script/Script Step
                                                                                Type:
                                                                              • Text: Export
                                                                              • Top: 261 pt
                                                                              • Left: 134 pt
                                                                              • Bottom: 289 pt
                                                                              • Right: 269 pt
                                                                              • Anchoring: Left, Bottom
                                                                              Export Field Contents [ Archives::Export; Create folders:Yes ]

                                                                              Fields:


                                                                              Script Hierarchy

                                                                              List Archive
                                                                              Create Archive
                                                                              Export Selected

                                                                              Next Script: [Create Archive]
                                                                              Script Name List Archive
                                                                              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
                                                                                • #Select an archive file
                                                                                • Set Variable [ $r; Value:MBS("FileDialog.Reset") ]
                                                                                • Set Variable [ $r; Value:MBS("FileDialog.SetAllowMulti"; 0) ]
                                                                                • Set Variable [ $r; Value:MBS("FileDialog.SetPrompt"; "Open") ]
                                                                                • Set Variable [ $r; Value:MBS("FileDialog.SetMessage"; "Please select zip file.") ]
                                                                                • Set Variable [ $r; Value:MBS("FileDialog.SetFilter"; "zip¶tar¶xar"; "*.zip;*.tar;*.xar"; "Archive files") ]
                                                                                • Set Variable [ $r; Value:MBS("FileDialog.OpenFileDialog") ]
                                                                                • If [ $r = "OK" ]
                                                                                • Delete All Records [ No dialog ]
                                                                                • Set Variable [ $path; Value:MBS("FileDialog.GetPath"; 0) ]
                                                                                • Set Variable [ $$LastPath; Value:$path ]
                                                                                • Set Variable [ $password; Value:"" ]
                                                                                • Set Variable [ $options; Value:"hdrcharset=UTF-8" ]
                                                                                • Set Variable [ $content; Value:MBS( "Archive.Content"; $path; $password; $options) ]
                                                                                • Set Variable [ $count; Value:MBS("JSON.GetPathItem"; $content; "count") ]
                                                                                • If [ $count > 0 ]
                                                                                • #loop counting up from 1 to $count
                                                                                • Set Variable [ $index; Value:0 ]
                                                                                • Loop [ Flush: Always ]
                                                                                • Set Variable [ $json; Value:MBS("JSON.GetPathItem"; $content; "files¶" & $index) ]
                                                                                • New Record/Request
                                                                                • Set Field [ Archives::JSON; MBS("JSON.Colorize"; $json) ]
                                                                                • Set Field [ Archives::PathName; JSONGetElement ( $json ; "PathName" ) ]
                                                                                • Set Field [ Archives::Size; JSONGetElement ( $json ; "Size" ) ]
                                                                                • Set Field [ Archives::ModificationTime; JSONGetElement ( $json ; "ModificationTime" ) ]
                                                                                • Set Field [ Archives::FileType; JSONGetElement ( $json ; "FileType" ) ]
                                                                                • Set Field [ Archives::Encrypted; If ( JSONGetElement ( $json ; "Encrypted" ) = 1; "yes"; "no" ) ]
                                                                                • Commit Records/Requests [ No dialog ]
                                                                                • #next
                                                                                • Set Variable [ $index; Value:$index + 1 ]
                                                                                • Exit Loop If [ $index >= $count ]
                                                                                • End Loop
                                                                                • 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: [List Archive] Next Script: [Export Selected]
                                                                                        Script Name Create Archive
                                                                                        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
                                                                                          • Set Variable [ $path; Value:MBS( "Path.AddPathComponent"; MBS( "Folders.UserDesktop" ); "test.zip" ) ]
                                                                                          • Set Variable [ $r; Value:MBS( "Archive.Create"; "zip"; "deflate"; $path) ]
                                                                                          • If [ MBS("IsError") ]
                                                                                          • Show Custom Dialog [ Title: "Failed to create zip archive."; Message: $r; Default Button: “OK”, Commit: “Yes” ]
                                                                                          • Exit Script [ ]
                                                                                          • End If
                                                                                          • #you can add text files
                                                                                          • Set Variable [ $r; Value:MBS( "Archive.AddText"; "Hello World!"; "UTF-8"; "test.txt") ]
                                                                                          • #or XML or JSON files
                                                                                          • Set Variable [ $r; Value:MBS( "Archive.AddText"; "<test>Hello World!</test>"; "UTF-8"; "test.xml") ]
                                                                                          • Set Variable [ $r; Value:MBS( "Archive.AddText"; "<html><p>Hello World!</p></html>"; "UTF-8"; "test.html") ]
                                                                                          • #or add a file
                                                                                          • Set Variable [ $r; Value:MBS("Archive.AddFile"; "Flower 1.jpg¶Flower 2.jpg"; "/Library/Desktop Pictures/") ]
                                                                                          • #of add a container
                                                                                          • Set Variable [ $r; Value:MBS( "Archive.AddContainer"; Archives::Image) ]
                                                                                          • Set Variable [ $r; Value:MBS( "Archive.Close") ]
                                                                                          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 Archive]
                                                                                                  Script Name Export Selected
                                                                                                  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
                                                                                                    • Set Variable [ $PathName; Value:Archives::PathName ]
                                                                                                    • If [ IsEmpty ( $PathName ) ]
                                                                                                    • #no record selected?
                                                                                                    • Beep
                                                                                                    • Else If [ IsEmpty ( $$LastPath ) ]
                                                                                                    • #no archive selected?
                                                                                                    • Beep
                                                                                                    • Else [ ]
                                                                                                    • Set Variable [ $options; Value:"hdrcharset=UTF-8" ]
                                                                                                    • Set Variable [ $password; Value:"" ]
                                                                                                    • Set Variable [ $data; Value:MBS( "Archive.ExtractFile"; $$LastPath; $PathName; $password; ""; $options) ]
                                                                                                    • If [ MBS("IsError") ]
                                                                                                    • Show Custom Dialog [ Title: "Failed to read file."; Message: $data; Default Button: “OK”, Commit: “Yes” ]
                                                                                                    • Else [ ]
                                                                                                    • Set Field [ Archives::Export; $data ]
                                                                                                    • If [ MBS("RemoteControl.IsAltKeyDown") ]
                                                                                                    • #export directly
                                                                                                    • Export Field Contents [ Archives::Export; Create folders:Yes ]
                                                                                                    • Else [ ]
                                                                                                    • #show in card
                                                                                                    • New Window [ Style: Card; Name: "Card"; Using layout: “Card”; Height: 300; Width: 400; Close: Yes; Minimize: No; Maximize: No; Resize: No; Menu Bar: No; Dim parent window: Yes; Toolbars: No ]
                                                                                                    • End If
                                                                                                    • 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: Archives

                                                                                                          Used functions: