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

MBS FileMaker Plugin Example Databases

Snippets for Windows

All examples are included with download of MBS FileMaker Plugin.

Snippets for Windows.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts10
Value Lists0
Custom Functions0
Custom Menus24
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
Snippets for Windows
7 fields defined, 8 records
Snippets for Windows

Fields

Table Name: Snippets for Windows - 7 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
PrimaryKeyNormal, TextAuto-Enter: 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
          CreationTimestampNormal, TimestampAuto-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
                  CreatedByNormal, TextAuto-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
                          ModificationTimestampNormal, TimestampAuto-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
                                  ModifiedByNormal, TextAuto-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
                                          DescriptionNormal, TextAuto-Enter:
                                          • Allow editing
                                          • Context table: Snippets for Windows
                                            Calculation: Substitute ( Substitute ( Substitute ( Self ; "\\" ; "-" ) ; ¶ ; "-" ) ; "/" ; "-" )
                                          Validation:
                                          • Only during data entry
                                          Storage:
                                          • Repetitions: 1
                                          • Indexing: None
                                          • Automatically create indexes as needed
                                          • Index Language: German
                                              SnippetNormal, TextAuto-Enter: Validation:
                                              • Only during data entry
                                              Storage:
                                              • Repetitions: 1
                                              • Indexing: None
                                              • Automatically create indexes as needed
                                              • Index Language: German

                                                  Layout Objects: Snippets for Windows

                                                  Regular Fields

                                                  Field Name: Snippets for Windows::Description
                                                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                  • Top: 75 pt
                                                  • Left: 138 pt
                                                  • Bottom: 106 pt
                                                  • Right: 621 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: Snippets for Windows::Snippet
                                                  Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                  • Top: 110 pt
                                                  • Left: 138 pt
                                                  • Bottom: 517 pt
                                                  • Right: 621 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: Copy To Clipboard
                                                  • Top: 531 pt
                                                  • Left: 140 pt
                                                  • Bottom: 562 pt
                                                  • Right: 312 pt
                                                  • Anchoring: Left, Top
                                                  Perform Script [ “Copy To Clipboard” ]

                                                  Scripts:


                                                  Button PropertiesCoordinatesScript/Script Step
                                                    Type:
                                                  • Text: Paste from Clipboard
                                                  • Top: 531 pt
                                                  • Left: 344 pt
                                                  • Bottom: 562 pt
                                                  • Right: 516 pt
                                                  • Anchoring: Left, Top
                                                  Perform Script [ “Paste From Clipboard” ]

                                                  Scripts:


                                                  Button PropertiesCoordinatesScript/Script Step
                                                    Type:
                                                  • Text: Export all Snippets to folder
                                                  • Top: 89 pt
                                                  • Left: 730 pt
                                                  • Bottom: 120 pt
                                                  • Right: 974 pt
                                                  • Anchoring: Left, Top
                                                  Perform Script [ “Write Snippets” ]

                                                  Scripts:


                                                  Button PropertiesCoordinatesScript/Script Step
                                                    Type:
                                                  • Text: Install Data Viewer Hotkey
                                                  • Top: 163 pt
                                                  • Left: 730 pt
                                                  • Bottom: 194 pt
                                                  • Right: 974 pt
                                                  • Anchoring: Left, Top
                                                  Perform Script [ “Install Hotkey for Show Hide Data Viewer” ]

                                                  Scripts:


                                                  Button PropertiesCoordinatesScript/Script Step
                                                    Type:
                                                  • Text: Install Insert Hotkey
                                                  • Top: 204 pt
                                                  • Left: 730 pt
                                                  • Bottom: 235 pt
                                                  • Right: 974 pt
                                                  • Anchoring: Left, Top
                                                  Perform Script [ “Install Hotkey for Insert Snippet” ]

                                                  Scripts:


                                                  Button PropertiesCoordinatesScript/Script Step
                                                    Type:
                                                  • Text: Install Picker Dialog Hotkey
                                                  • Top: 245 pt
                                                  • Left: 730 pt
                                                  • Bottom: 276 pt
                                                  • Right: 974 pt
                                                  • Anchoring: Left, Top
                                                  Perform Script [ “Install Picker Dialog” ]

                                                  Scripts:


                                                  Script Hierarchy

                                                  Release All Hotkeys
                                                  Install Hotkey for Show Hide Data Viewer
                                                  Install Hotkey for Insert Snippet
                                                  -
                                                  test
                                                  -
                                                  Copy To Clipboard
                                                  Paste From Clipboard
                                                  Write Snippets
                                                  Install Picker Dialog

                                                  Next Script: [Install Hotkey for Show Hide Data Viewer]
                                                  Script NameRelease All Hotkeys
                                                  Run script with full access privilegesOff
                                                  Include In MenuYes
                                                  Layouts that use this script
                                                    Scripts that use this script
                                                      Script Definition
                                                      Script Steps
                                                      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: [Release All Hotkeys]Next Script: [Install Hotkey for Insert Snippet]
                                                                    Script NameInstall Hotkey for Show Hide Data Viewer
                                                                    Run script with full access privilegesOff
                                                                    Include In MenuYes
                                                                    Layouts that use this script
                                                                    Scripts that use this script
                                                                      Script Definition
                                                                      Script Steps
                                                                      • # Control - F5 for showing/hiding data viewer
                                                                      • Set Variable [ $hotkey; Value:MBS("Hotkey.Register"; "F5"; "control") ]
                                                                      • If [ MBS("IsError") ]
                                                                      • Show Custom Dialog [ Title: "Failed to register hotkey!"; Message: $hotkey; Default Button: “OK”, Commit: “Yes” ]
                                                                      • Exit Script [ ]
                                                                      • End If
                                                                      • Set Variable [ $r; Value:MBS( "HotKey.SetEvaluate"; $hotkey; "MBS(\"Menubar.RunMenuCommand\"; 49297)" ) ]
                                                                      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: [Install Hotkey for Show Hide Data Viewer]Next Script: [-]
                                                                                    Script NameInstall Hotkey for Insert Snippet
                                                                                    Run script with full access privilegesOff
                                                                                    Include In MenuYes
                                                                                    Layouts that use this script
                                                                                    Scripts that use this script
                                                                                      Script Definition
                                                                                      Script Steps
                                                                                      • #Insert sample snippet with Control-F6
                                                                                      • Set Variable [ $hotkey; Value:MBS("HotKey.Register"; "F6"; "control") ]
                                                                                      • If [ MBS("IsError") ]
                                                                                      • Show Custom Dialog [ Title: "Failed to register hotkey!"; Message: $hotkey; Default Button: “OK”, Commit: “Yes” ]
                                                                                      • Exit Script [ ]
                                                                                      • End If
                                                                                      • Set Variable [ $r; Value:MBS( "HotKey.SetEvaluate"; $hotkey; "Let ([ xml = \"<fmxmlsnippet type=\\\"FMObjectList\\\"><Step enable=\\\"True\\\" id=\\\"89\\\" name=\\\"# (comment)\\\"><Text>loop counting up from 1 to $count</Text></Step><Step enable=\\\"True\\\" id=\\\"141\\\" name=\\\"Set Variable\\\"><Value><Calculation><![CDATA[\\\"/* add count here */\\\"]]></Calculation></Value><Repetition><Calculation><![CDATA[1]]></Calculation></Repetition><Name>$count</Name></Step><Step enable=\\\"True\\\" id=\\\"141\\\" name=\\\"Set Variable\\\"><Value><Calculation><![CDATA[1]]></Calculation></Value><Repetition><Calculation><![CDATA[1]]></Calculation></Repetition><Name>$index</Name></Step><Step enable=\\\"True\\\" id=\\\"68\\\" name=\\\"If\\\"><Calculation><![CDATA[$index ≤ $count]]></Calculation></Step><Step enable=\\\"True\\\" id=\\\"71\\\" name=\\\"Loop\\\"></Step><Step enable=\\\"True\\\" id=\\\"89\\\" name=\\\"# (comment)\\\"><Text>your script steps here</Text></Step><Step enable=\\\"True\\\" id=\\\"89\\\" name=\\\"# (comment)\\\"></Step><Step enable=\\\"True\\\" id=\\\"89\\\" name=\\\"# (comment)\\\"><Text>next</Text></Step><Step enable=\\\"True\\\" id=\\\"141\\\" name=\\\"Set Variable\\\"><Value><Calculation><![CDATA[$index + 1]]></Calculation></Value><Repetition><Calculation><![CDATA[1]]></Calculation></Repetition><Name>$index</Name></Step><Step enable=\\\"True\\\" id=\\\"72\\\" name=\\\"Exit Loop If\\\"><Calculation><![CDATA[$index > $count]]></Calculation></Step><Step enable=\\\"True\\\" id=\\\"73\\\" name=\\\"End Loop\\\"></Step><Step enable=\\\"True\\\" id=\\\"70\\\" name=\\\"End If\\\"></Step></fmxmlsnippet>\"; r = MBS( \"Clipboard.SetFileMakerData\"; \"ScriptStep\"; xml ); r = MBS( \"RemoteControl.PressControlKey\"; 1 ); r = MBS( \"RemoteControl.PressKey\"; \"v\"); r = MBS( \"RemoteControl.PressControlKey\"; 0 ) ]; 1 )"; 0 ) // for Windows ]
                                                                                      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: [Install Hotkey for Insert Snippet]Next Script: [test]
                                                                                                    Script Name-
                                                                                                    Run script with full access privilegesOff
                                                                                                    Include In MenuYes
                                                                                                    Layouts that use this script
                                                                                                      Scripts that use this script
                                                                                                        Script Definition
                                                                                                        Script Steps
                                                                                                          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: [-]Next Script: [-]
                                                                                                                        Script Nametest
                                                                                                                        Run script with full access privilegesOff
                                                                                                                        Include In MenuYes
                                                                                                                        Layouts that use this script
                                                                                                                          Scripts that use this script
                                                                                                                            Script Definition
                                                                                                                            Script Steps
                                                                                                                            • #this is the test script
                                                                                                                            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: [test]Next Script: [Copy To Clipboard]
                                                                                                                                          Script Name-
                                                                                                                                          Run script with full access privilegesOff
                                                                                                                                          Include In MenuYes
                                                                                                                                          Layouts that use this script
                                                                                                                                            Scripts that use this script
                                                                                                                                              Script Definition
                                                                                                                                              Script Steps
                                                                                                                                                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: [-]Next Script: [Paste From Clipboard]
                                                                                                                                                              Script NameCopy To Clipboard
                                                                                                                                                              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( "Clipboard.SetFileMakerData"; "auto"; Snippets for Windows::Snippet ) ]
                                                                                                                                                                • If [ MBS("IsError") ]
                                                                                                                                                                • Show Custom Dialog [ Title: "Failed?"; Message: $r; Default Button: “OK”, Commit: “Yes” ]
                                                                                                                                                                • 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: [Copy To Clipboard]Next Script: [Write Snippets]
                                                                                                                                                                        Script NamePaste From Clipboard
                                                                                                                                                                        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 [ $text; Value:MBS( "Clipboard.GetFileMakerData"; "auto") ]
                                                                                                                                                                          • If [ MBS("IsError") ]
                                                                                                                                                                          • Show Custom Dialog [ Title: "Failed?"; Message: $text; Default Button: “OK”, Commit: “Yes” ]
                                                                                                                                                                          • Else
                                                                                                                                                                          • Set Field [ Snippets for Windows::Snippet; $text ]
                                                                                                                                                                          • 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: [Paste From Clipboard]Next Script: [Install Picker Dialog]
                                                                                                                                                                                  Script NameWrite Snippets
                                                                                                                                                                                  Run script with full access privilegesOff
                                                                                                                                                                                  Include In MenuYes
                                                                                                                                                                                  Layouts that use this script
                                                                                                                                                                                  Scripts that use this script
                                                                                                                                                                                    Script Definition
                                                                                                                                                                                    Script Steps
                                                                                                                                                                                    • #save pending changes for current record
                                                                                                                                                                                    • Commit Records/Requests [ No dialog ]
                                                                                                                                                                                    • #new card window to keep current selection
                                                                                                                                                                                    • New Window [ Style: Document; Using layout: “Snippets for Windows”; Top: -10000; Close: Yes; Minimize: No; Maximize: No; Resize: No; Menu Bar: No; Dim parent window: No; Toolbars: No ]
                                                                                                                                                                                    • #now export all snippets
                                                                                                                                                                                    • Go to Record/Request/Page [ First ]
                                                                                                                                                                                    • Loop
                                                                                                                                                                                    • Set Variable [ $path; Value:"file:" & Get(DocumentsPath) & "Snippets/" & Snippets for Windows::Description & ".xml" ]
                                                                                                                                                                                    • Export Field Contents [ Snippets for Windows::Snippet; “$Path”; Create directories:Yes ]
                                                                                                                                                                                    • Go to Record/Request/Page [ Next; Exit after last ]
                                                                                                                                                                                    • End Loop
                                                                                                                                                                                    • Close Window [ Current Window ]
                                                                                                                                                                                    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: [Write Snippets]
                                                                                                                                                                                          Script NameInstall Picker Dialog
                                                                                                                                                                                          Run script with full access privilegesOff
                                                                                                                                                                                          Include In MenuYes
                                                                                                                                                                                          Layouts that use this script
                                                                                                                                                                                          Scripts that use this script
                                                                                                                                                                                            Script Definition
                                                                                                                                                                                            Script Steps
                                                                                                                                                                                            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: Snippets for Windows

                                                                                                                                                                                                          Used functions: