MBS FileMaker Plugin Example Databases

WIA Scan

All examples are included with download of MBS FileMaker Plugin.

WIA Scan.fmp12

Overview
Tables2
Relationships0
Layouts3
Scripts10
Value Lists0
Custom Functions0
Custom Menus0
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
WIA Scan
3 fields defined, 0 record
WIA Scan
Images
2 fields defined, 0 record
Images

Fields

Table Name: WIA Scan - 3 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
DeviceNormal, TextAuto-Enter:
  • Allow editing
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
  • Indexing: None
  • Automatically create indexes as needed
  • Index Language: German
      KeyNormal, TextAuto-Enter:
      • Allow editing
      Validation:
      • Only during data entry
      Storage:
      • Repetitions: 1
      • Indexing: None
      • Automatically create indexes as needed
      • Index Language: German
          ValueNormal, TextAuto-Enter:
          • Allow editing
          Validation:
          • Only during data entry
          Storage:
          • Repetitions: 1
          • Indexing: None
          • Automatically create indexes as needed
          • Index Language: German

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

                      Layout Objects: WIA Scan

                      Regular Fields

                      Field Name: WIA Scan::Device
                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                      • Top: 114 pt
                      • Left: 4 pt
                      • Bottom: 136 pt
                      • Right: 134 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: WIA Scan::Key
                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                      • Top: 114 pt
                      • Left: 142 pt
                      • Bottom: 136 pt
                      • Right: 395 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: WIA Scan::Value
                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                      • Top: 114 pt
                      • Left: 403 pt
                      • Bottom: 136 pt
                      • Right: 827 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

                      Buttons

                      Button PropertiesCoordinatesScript/Script Step
                        Type:
                      • Text: Initialize
                      • Top: 16 pt
                      • Left: 9 pt
                      • Bottom: 41 pt
                      • Right: 124 pt
                      • Anchoring: Left, Top
                      Perform Script [ “Initialize” ]

                      Scripts:


                      Button PropertiesCoordinatesScript/Script Step
                        Type:
                      • Text: Select Device Dialog
                      • Top: 16 pt
                      • Left: 134 pt
                      • Bottom: 41 pt
                      • Right: 279 pt
                      • Anchoring: Left, Top
                      Perform Script [ “SelectDevice” ]

                      Scripts:


                      Button PropertiesCoordinatesScript/Script Step
                        Type:
                      • Text: List Devices
                      • Top: 16 pt
                      • Left: 290 pt
                      • Bottom: 41 pt
                      • Right: 423 pt
                      • Anchoring: Left, Top
                      Perform Script [ “List Devices” ]

                      Scripts:


                      Button PropertiesCoordinatesScript/Script Step
                        Type:
                      • Text: Current Device
                      • Top: 16 pt
                      • Left: 434 pt
                      • Bottom: 41 pt
                      • Right: 567 pt
                      • Anchoring: Left, Top
                      Perform Script [ “List Properties”; Parameter: "" ]

                      Scripts:


                      Button PropertiesCoordinatesScript/Script Step
                        Type:
                      • Text: Select Device
                      • Top: 114 pt
                      • Left: 845 pt
                      • Bottom: 137 pt
                      • Right: 960 pt
                      • Anchoring: Left, Top
                      Perform Script [ “Select Device” ]

                      Scripts:


                      Button PropertiesCoordinatesScript/Script Step
                        Type:
                      • Text: Image Dialog
                      • Top: 16 pt
                      • Left: 578 pt
                      • Bottom: 41 pt
                      • Right: 711 pt
                      • Anchoring: Left, Top
                      Perform Script [ “Get Image Dialog”; Parameter: "" ]

                      Scripts:


                      Layout Objects: Images

                      Regular Fields

                      Field Name: Images::Name
                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                      • Top: 52 pt
                      • Left: 138 pt
                      • Bottom: 74 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: Default for Data Type
                      • Go to next field using: Tab key
                      Yes

                      Field Name: Images::Image
                      Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                      • Top: 76 pt
                      • Left: 138 pt
                      • Bottom: 523 pt
                      • Right: 879 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 PropertiesCoordinatesScript/Script Step
                        Type:
                      • Text: Back
                      • Top: 6 pt
                      • Left: 39 pt
                      • Bottom: 36 pt
                      • Right: 189 pt
                      • Anchoring: Left, Top
                      Go to Layout [ “WIA Scan” (WIA Scan) ]

                      Layouts:


                      Script Hierarchy

                      Initialize
                      SelectDevice
                      List Devices
                      List Properties
                      Select Device
                      Clear All
                      Get Image Dialog
                      Scan Flatbed
                      Scan Flatbed with Dialog
                      Import Images

                      Next Script: [SelectDevice]
                      Script NameInitialize
                      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 [ $r; Value:MBS("WIA.Initialize") ]
                        • Show Custom Dialog [ Title: "WIA Initialize"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                        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: [Initialize]Next Script: [List Devices]
                                      Script NameSelectDevice
                                      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 Layout [ “WIA Scan” (WIA Scan) ]
                                        • Delete All Records [ No dialog ]
                                        • Set Variable [ $r; Value:MBS("WIA.SelectDeviceDialog"; "Scanner") ]
                                        • If [ $r = "OK" ]
                                        • Show Custom Dialog [ Title: "Select Device Dialog Result"; Message: "DeviceID: " & MBS("WIA.GetCurrentDevice") & ¶ & "Name: " & MBS("WIA.DevicePropertyValue"; ""; "Name"); Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                                        • #List properties of current device:
                                        • Perform Script [ “List Properties”; Parameter: "" ]
                                        • Else
                                        • Show Custom Dialog [ Title: "Select Device Dialog Result"; Message: $r; 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

                                                  Previous Script: [SelectDevice]Next Script: [List Properties]
                                                  Script NameList Devices
                                                  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 Layout [ “WIA Scan” (WIA Scan) ]
                                                    • Delete All Records [ No dialog ]
                                                    • Set Variable [ $c; Value:MBS("WIA.DeviceCount") ]
                                                    • If [ MBS("IsError") ]
                                                    • Show Custom Dialog [ Title: "Error"; Message: $c; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                                                    • Else
                                                    • If [ $c > 0 ]
                                                    • Set Variable [ $i; Value:0 ]
                                                    • Loop
                                                    • Perform Script [ “List Properties”; Parameter: $i ]
                                                    • #Next
                                                    • Set Variable [ $i; Value:$i + 1 ]
                                                    • Exit Loop If [ $i >= $c ]
                                                    • 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 Devices]Next Script: [Select Device]
                                                              Script NameList Properties
                                                              Run script with full access privilegesOff
                                                              Include In MenuNo
                                                              Layouts that use this script
                                                              Scripts that use this script
                                                              Script Definition
                                                              Script Steps
                                                              • Set Variable [ $device; Value:Get(ScriptParameter) ]
                                                              • Set Variable [ $list; Value:MBS("WIA.DevicePropertyKeys"; $device) ]
                                                              • If [ MBS("IsError") ]
                                                              • Show Custom Dialog [ Title: "Error"; Message: $list; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                                                              • Else
                                                              • Set Variable [ $count; Value:ValueCount ( $list ) ]
                                                              • If [ $count > 0 ]
                                                              • Set Variable [ $i; Value:1 ]
                                                              • Loop
                                                              • Set Variable [ $key; Value:GetValue ( $list; $i) ]
                                                              • Set Variable [ $value; Value:MBS("WIA.DevicePropertyValue"; $device; $key) ]
                                                              • New Record/Request
                                                              • Set Field [ WIA Scan::Device; $device ]
                                                              • Set Field [ WIA Scan::Key; $key ]
                                                              • Set Field [ WIA Scan::Value; $value ]
                                                              • Commit Records/Requests [ No dialog ]
                                                              • #Next
                                                              • Set Variable [ $i; Value:$i+1 ]
                                                              • Exit Loop If [ $i > $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 Properties]Next Script: [Clear All]
                                                                      Script NameSelect Device
                                                                      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 [ $r; Value:MBS("WIA.SetCurrentDevice"; WIA Scan::Value) ]
                                                                        • If [ $r = "OK" ]
                                                                        • Show Custom Dialog [ Title: "Select Device Dialog Result"; Message: "DeviceID: " & MBS("WIA.GetCurrentDevice") & ¶ & "Name: " & MBS("WIA.DevicePropertyValue"; ""; "Name"); Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                                                                        • Else
                                                                        • Show Custom Dialog [ Title: "Select Device Dialog Result"; Message: $r; 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

                                                                                Previous Script: [Select Device]Next Script: [Get Image Dialog]
                                                                                Script NameClear All
                                                                                Run script with full access privilegesOff
                                                                                Include In MenuYes
                                                                                Layouts that use this script
                                                                                  Scripts that use this script
                                                                                    Script Definition
                                                                                    Script Steps
                                                                                    • Truncate Table [ No dialog; Table: “WIA Scan” ]
                                                                                    • Truncate Table [ No dialog; Table: “Images” ]
                                                                                    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: [Clear All]Next Script: [Scan Flatbed]
                                                                                                  Script NameGet Image Dialog
                                                                                                  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 [ $folder; Value:MBS( "Folders.UserTemporary" ) ]
                                                                                                    • Set Variable [ $path; Value:MBS( "Path.AddPathComponent"; $folder; "FileMakerScans") ]
                                                                                                    • Set Variable [ $r; Value:MBS( "Files.CreateDirectory"; $path) ]
                                                                                                    • #Scan...
                                                                                                    • Set Variable [ $r; Value:MBS("WIA.ImageDialog"; "Default"; $path; "scan") ]
                                                                                                    • #Result can be OK or Cancel and in both cases some images may be there
                                                                                                    • If [ $r ≠ "OK" ]
                                                                                                    • Show Custom Dialog [ Title: "Scan Result"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                                                                                                    • Else
                                                                                                    • Perform Script [ “Import Images” ]
                                                                                                    • 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: [Get Image Dialog]Next Script: [Scan Flatbed with Dialog]
                                                                                                                Script NameScan Flatbed
                                                                                                                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 [ $r; Value:MBS( "WIA.Scan"; "Flatbed") ]
                                                                                                                    • #Result can be OK or Cancel and in both cases some images may be there
                                                                                                                    • If [ $r ≠ "OK" ]
                                                                                                                    • Show Custom Dialog [ Title: "Scan Result"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                                                                                                                    • Else
                                                                                                                    • Perform Script [ “Import Images” ]
                                                                                                                    • 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: [Scan Flatbed]Next Script: [Import Images]
                                                                                                                                Script NameScan Flatbed with Dialog
                                                                                                                                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 [ $r; Value:MBS( "ProgressDialog.Reset" ) ]
                                                                                                                                    • Set Variable [ $r; Value:MBS( "ProgressDialog.SetTitle"; "Please wait") ]
                                                                                                                                    • Set Variable [ $r; Value:MBS( "ProgressDialog.SetTopText"; "Scanning...") ]
                                                                                                                                    • Set Variable [ $r; Value:MBS( "ProgressDialog.SetProgress"; -1 ) ]
                                                                                                                                    • Set Variable [ $r; Value:MBS( "ProgressDialog.Show" ) ]
                                                                                                                                    • // Set Variable [ $r; Value:MBS( "WIA.SetItemPropertyValue"; "Flatbed"; "Rotation"; 2 ) // 0 = Portrait, 1 = Landscape, 2 = Rotate 180, 3 = Rotate 270 ]
                                                                                                                                    • Set Variable [ $r; Value:MBS( "WIA.Scan"; "Flatbed") ]
                                                                                                                                    • Set Variable [ $d; Value:MBS( "ProgressDialog.Hide" ) ]
                                                                                                                                    • #Result can be OK on success.
                                                                                                                                    • If [ $r ≠ "OK" ]
                                                                                                                                    • Show Custom Dialog [ Title: "Scan Result"; Message: $r; Default Button: “OK”, Commit: “Yes”; Button 2: “Cancel”, Commit: “No” ]
                                                                                                                                    • Else
                                                                                                                                    • Perform Script [ “Import Images” ]
                                                                                                                                    • 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: [Scan Flatbed with Dialog]
                                                                                                                                                Script NameImport Images
                                                                                                                                                Run script with full access privilegesOff
                                                                                                                                                Include In MenuNo
                                                                                                                                                Layouts that use this script
                                                                                                                                                  Scripts that use this script
                                                                                                                                                  Script Definition
                                                                                                                                                  Script Steps
                                                                                                                                                  • Set Variable [ $count; Value:MBS( "WIA.ImageCount") ]
                                                                                                                                                  • If [ $count > 0 ]
                                                                                                                                                  • Set Variable [ $i; Value:0 ]
                                                                                                                                                  • Go to Layout [ “Images” (Images) ]
                                                                                                                                                  • Loop
                                                                                                                                                  • Set Variable [ $ImagePath; Value:MBS( "WIA.Image"; $i) ]
                                                                                                                                                  • Set Variable [ $image; Value:MBS( "Container.ReadFile"; $ImagePath) ]
                                                                                                                                                  • New Record/Request
                                                                                                                                                  • Set Field [ Images::Name; MBS( "Path.LastPathComponent"; $ImagePath ) ]
                                                                                                                                                  • Set Field [ Images::Image; $image ]
                                                                                                                                                  • Commit Records/Requests [ No dialog ]
                                                                                                                                                  • #Next
                                                                                                                                                  • Set Variable [ $i; Value:$i + 1 ]
                                                                                                                                                  • Exit Loop If [ $i >= $count ]
                                                                                                                                                  • End Loop
                                                                                                                                                  • 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: WIA Scan

                                                                                                                                                        Used functions:




                                                                                                                                                        Links
                                                                                                                                                        MBS Xojo PDF Plugins