MBS FileMaker Plugin Example Databases

Script Workspace Context Menu Commands

All examples are included with download of MBS FileMaker Plugin.

Script Workspace Context Menu Commands.fmp12

Overview
Tables1
Relationships0
Layouts1
Scripts3
Value Lists3
Custom Functions1
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
Syntax Coloring Context Menü Commands
13 fields defined, 8 records
Syntax Coloring Context Menü Commands

Fields

Table Name: Syntax Coloring Context Menü Commands - 13 Fields
Field NameTypeOptionsCommentsOn LayoutsIn RelationshipsIn ScriptsIn Value Lists
uniqueIDNormal, NumberAuto-Enter:
  • Serial: Generate: On creation, Next value: 15, Increment: 1
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
  • Indexing: None
  • Automatically create indexes as needed
  • Index Language: English
          created_TimeStampNormal, TimestampAuto-Enter:
          • Creation timestamp
          Validation:
          • Only during data entry
          • Strict validation
          Storage:
          • Repetitions: 1
          • Indexing: All
          • Index Language: English
                  created_AccountNameNormal, TextAuto-Enter:
                  • Creation account name
                  Validation:
                  • Only during data entry
                  • Strict validation
                  Storage:
                  • Repetitions: 1
                  • Indexing: All
                  • Index Language: English
                          modified_TimeStampNormal, TimestampAuto-Enter:
                          • Modification timestamp
                          • Allow editing
                          Validation:
                          • Only during data entry
                          • Strict validation
                          Storage:
                          • Repetitions: 1
                          • Indexing: All
                          • Index Language: English
                                  modified_AccountNameNormal, TextAuto-Enter:
                                  • Modification account name
                                  Validation:
                                  • Only during data entry
                                  • Strict validation
                                  Storage:
                                  • Repetitions: 1
                                  • Indexing: All
                                  • Index Language: English
                                          OneCalculated, NumberCalculation: Auto-Enter:
                                          • Always evaluate
                                          Storage:
                                          • Repetitions: 1
                                          • Indexing: None
                                          • Automatically create indexes as needed
                                          • Index Language: English
                                                  commandCodeMasterBlockNormal, TextAuto-Enter:
                                                  • Value from last visited record
                                                  • Allow editing
                                                  Validation:
                                                  • Only during data entry
                                                  Storage:
                                                  • Repetitions: 1
                                                  • Indexing: None
                                                  • Automatically create indexes as needed
                                                  • Index Language: English
                                                        commandNeedsSelectionNormal, TextAuto-Enter:
                                                        • Value from last visited record
                                                        • Allow editing
                                                        Validation:
                                                        • Only during data entry
                                                        Storage:
                                                        • Repetitions: 1
                                                        • Indexing: None
                                                        • Automatically create indexes as needed
                                                        • Index Language: English
                                                            commandTitleNormal, TextAuto-Enter:
                                                            • Allow editing
                                                            Validation:
                                                            • Only during data entry
                                                            Storage:
                                                            • Repetitions: 1
                                                            • Indexing: None
                                                            • Automatically create indexes as needed
                                                            • Index Language: English
                                                                ClipboardGetTypeNormal, TextAuto-Enter:
                                                                • Allow editing
                                                                Validation:
                                                                • Only during data entry
                                                                Storage:
                                                                • Repetitions: 1
                                                                • Indexing: None
                                                                • Automatically create indexes as needed
                                                                • Index Language: English
                                                                    ClipboardContentNormal, TextAuto-Enter:
                                                                    • Allow editing
                                                                    Validation:
                                                                    • Only during data entry
                                                                    Storage:
                                                                    • Repetitions: 1
                                                                    • Indexing: None
                                                                    • Automatically create indexes as needed
                                                                    • Index Language: English
                                                                        commandCodeCalculatedCalculated, TextCalculation: Storage:
                                                                        • Repetitions: 1
                                                                        • Indexing: None
                                                                        • Automatically create indexes as needed
                                                                        • Index Language: English
                                                                            ActiveNormal, NumberAuto-Enter:
                                                                            • Allow editing
                                                                            Validation:
                                                                            • Only during data entry
                                                                            Storage:
                                                                            • Repetitions: 1
                                                                            • Indexing: All
                                                                            • Index Language: English

                                                                                Layout Objects: Syntax Coloring Context Menü Commands

                                                                                Regular Fields

                                                                                Field Name: Syntax Coloring Context Menü Commands::commandCodeMasterBlock
                                                                                Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                • Top: 134 pt
                                                                                • Left: 757 pt
                                                                                • Bottom: 587 pt
                                                                                • Right: 1358 pt
                                                                                • Anchoring: Left, Top
                                                                                Field Format:
                                                                                • Edit Box
                                                                                • Include vertical scrollbar
                                                                                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: Syntax Coloring Context Menü Commands::commandTitle
                                                                                Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                • Top: 57 pt
                                                                                • Left: 171 pt
                                                                                • Bottom: 78 pt
                                                                                • Right: 772 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: Syntax Coloring Context Menü Commands::ClipboardGetType
                                                                                Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                • Top: 611 pt
                                                                                • Left: 154 pt
                                                                                • Bottom: 632 pt
                                                                                • Right: 407 pt
                                                                                • Anchoring: Left, Top
                                                                                Field Format: 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: Syntax Coloring Context Menü Commands::ClipboardContent
                                                                                Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                • Top: 637 pt
                                                                                • Left: 154 pt
                                                                                • Bottom: 869 pt
                                                                                • Right: 749 pt
                                                                                • Anchoring: Left, Top
                                                                                Field Format:
                                                                                • Edit Box
                                                                                • Include vertical scrollbar
                                                                                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: Syntax Coloring Context Menü Commands::commandCodeCalculated
                                                                                Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                • Top: 134 pt
                                                                                • Left: 148 pt
                                                                                • Bottom: 587 pt
                                                                                • Right: 749 pt
                                                                                • Anchoring: Left, Top
                                                                                Field Format:
                                                                                • Edit Box
                                                                                • Include vertical scrollbar
                                                                                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: Syntax Coloring Context Menü Commands::commandNeedsSelection
                                                                                Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                • Top: 95 pt
                                                                                • Left: 148 pt
                                                                                • Bottom: 116 pt
                                                                                • Right: 401 pt
                                                                                • Anchoring: Left, Top
                                                                                Field Format: 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: Syntax Coloring Context Menü Commands::Active
                                                                                Field PropertiesCoordinatesField FormatField BehaviorQuick Find
                                                                                • Top: 57 pt
                                                                                • Left: 148 pt
                                                                                • Bottom: 78 pt
                                                                                • Right: 164 pt
                                                                                • Anchoring: Left, Top
                                                                                Field Format:
                                                                                • Checkbox Set
                                                                                • Display values from: 1
                                                                                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: Get Clipboard Data
                                                                                • Top: 610 pt
                                                                                • Left: 432 pt
                                                                                • Bottom: 632 pt
                                                                                • Right: 667 pt
                                                                                • Anchoring: Left, Top
                                                                                Perform Script [ “GetClipboard” ]

                                                                                Scripts:


                                                                                Button PropertiesCoordinatesScript/Script Step
                                                                                  Type:
                                                                                • Text: Install
                                                                                • Top: 56 pt
                                                                                • Left: 778 pt
                                                                                • Bottom: 78 pt
                                                                                • Right: 873 pt
                                                                                • Anchoring: Left, Top
                                                                                Perform Script [ “Install Command”; Parameter: "Install Single Command" ]

                                                                                Scripts:


                                                                                Button PropertiesCoordinatesScript/Script Step
                                                                                  Type:
                                                                                • Text: DeInstall
                                                                                • Top: 57 pt
                                                                                • Left: 879 pt
                                                                                • Bottom: 79 pt
                                                                                • Right: 974 pt
                                                                                • Anchoring: Left, Top
                                                                                Perform Script [ “Install Command”; Parameter: "Delete Command" ]

                                                                                Scripts:


                                                                                Button PropertiesCoordinatesScript/Script Step
                                                                                  Type:
                                                                                • Text: Clear all installed commands
                                                                                • Top: 88 pt
                                                                                • Left: 1014 pt
                                                                                • Bottom: 110 pt
                                                                                • Right: 1306 pt
                                                                                • Anchoring: Left, Top
                                                                                Perform Script [ “Install Command”; Parameter: "Delete All Command" ]

                                                                                Scripts:


                                                                                Button PropertiesCoordinatesScript/Script Step
                                                                                  Type:
                                                                                • Text: Install all Active Commands
                                                                                • Top: 88 pt
                                                                                • Left: 778 pt
                                                                                • Bottom: 110 pt
                                                                                • Right: 974 pt
                                                                                • Anchoring: Left, Top
                                                                                Perform Script [ “Install Command”; Parameter: "Install Active Commands" ]

                                                                                Scripts:


                                                                                Value Lists

                                                                                Value List NameSourceValuesOn Layouts
                                                                                NeedSelectionCustom
                                                                                • 0: always on, 1: need no row selected, 2: need exactly one row selected, 3: need one or more rows selected, 4: need all rows selected
                                                                                GetClipboardTypesCustom
                                                                                • Script, ScriptStep, Layout, ValueList, CustomFunction, Table, Field, Layout12
                                                                                1Custom
                                                                                • 1

                                                                                Script Hierarchy

                                                                                Install Command
                                                                                GetClipboard
                                                                                My Colletion of frequently used items

                                                                                Next Script: [GetClipboard]
                                                                                Script NameInstall Command
                                                                                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 [ $ScriptParameter; Value:Get(ScriptParameter) ]
                                                                                • If [ PatternCount ( $ScriptParameter ; "Install Single Command") > 0 ]
                                                                                • Set Variable [ $r; Value:MBS( "SyntaxColoring.AddContextMenuCommand"; Syntax Coloring Context Menü Commands::commandTitle ; /* The title for the menu command. If title is just "-", we add a separator.e.g. "MyCommands¶Hello" */ Syntax Coloring Context Menü Commands::commandCodeCalculated ; /* The expression to evaluate in FileMaker when menu command is choosen. */ Left ( Syntax Coloring Context Menü Commands::commandNeedsSelection ; 1 )) /* Whether to enable only if selection is present. */ ]
                                                                                • If [ $r ≠ "OK" ]
                                                                                • Show Custom Dialog [ Title: "Result"; Message: "Command: " & "\"" & Syntax Coloring Context Menü Commands::commandTitle & "\" could not be installed because of Error: " & $r; Default Button: “OK”, Commit: “Yes” ]
                                                                                • End If
                                                                                • End If
                                                                                • If [ PatternCount ( $ScriptParameter ; "Install Active Commands") > 0 ]
                                                                                • Set Error Capture [ On ]
                                                                                • Enter Find Mode [ ]
                                                                                • Set Field [ Syntax Coloring Context Menü Commands::Active; 1 ]
                                                                                • Perform Find [ ]
                                                                                • If [ Get(FoundCount) > 0 ]
                                                                                • #Hier die gefundenen verarbeiten
                                                                                • Show Custom Dialog [ Title: "Clear all commands first?"; Message: "Do you want to clean all currently installed commands?"; Default Button: “Ok”, Commit: “Yes”; Button 2: “Skip”, Commit: “No” ]
                                                                                • If [ Get(LastMessageChoice) = 1 ]
                                                                                • Perform Script [ “Install Command”; Parameter: "Delete All Commands" ]
                                                                                • End If
                                                                                • Go to Record/Request/Page [ First ]
                                                                                • Loop
                                                                                • Perform Script [ “Install Command”; Parameter: "Install Single Command" ]
                                                                                • Go to Record/Request/Page [ Next; Exit after last ]
                                                                                • End Loop
                                                                                • End If
                                                                                • End If
                                                                                • If [ PatternCount ( $ScriptParameter ; "Delete Command") > 0 ]
                                                                                • Set Variable [ $r; Value:MBS( "SyntaxColoring.RemoveContextMenuCommand"; Syntax Coloring Context Menü Commands::commandTitle ) ]
                                                                                • If [ $r ≠ "OK" ]
                                                                                • Show Custom Dialog [ Title: "Result"; Message: $r; Default Button: “OK”, Commit: “Yes” ]
                                                                                • End If
                                                                                • End If
                                                                                • If [ PatternCount ( $ScriptParameter ; "Delete All Commands") > 0 ]
                                                                                • Set Variable [ $r; Value:MBS( "SyntaxColoring.ClearContextMenuCommands" ) ]
                                                                                • If [ $r ≠ "OK" ]
                                                                                • Show Custom Dialog [ Title: "Result"; Message: $r; Default Button: “OK”, Commit: “Yes” ]
                                                                                • 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: [Install Command]Next Script: [My Colletion of frequently used items]
                                                                                      Script NameGetClipboard
                                                                                      Run script with full access privilegesOff
                                                                                      Include In MenuNo
                                                                                      Layouts that use this script
                                                                                      Scripts that use this script
                                                                                        Script Definition
                                                                                        Script Steps
                                                                                        • If [ IsEmpty ( Syntax Coloring Context Menü Commands::ClipboardGetType ) ]
                                                                                        • Beep
                                                                                        • Show Custom Dialog [ Title: "Clipboard Type?"; Message: "Please specify a clipboard type"; Default Button: “Stop”, Commit: “Yes” ]
                                                                                        • Halt Script
                                                                                        • End If
                                                                                        • If [ Syntax Coloring Context Menü Commands::ClipboardGetType ≠ "ScriptStep" ]
                                                                                        • Beep
                                                                                        • Show Custom Dialog [ Title: "Clipboard Type"; Message: "The clipboard type: " & Syntax Coloring Context Menü Commands::ClipboardGetType & " can not be used for this purpose."; Default Button: “Stop”, Commit: “Yes” ]
                                                                                        • Halt Script
                                                                                        • End If
                                                                                        • If [ not IsEmpty ( Syntax Coloring Context Menü Commands::ClipboardContent ) ]
                                                                                        • Show Custom Dialog [ Title: "Overwrite"; Message: "The clipboard content is not empty. Overwrite?"; Default Button: “Cancel”, Commit: “Yes”; Button 2: “OK”, Commit: “No” ]
                                                                                        • If [ Get(LastMessageChoice) = 1 ]
                                                                                        • Halt Script
                                                                                        • End If
                                                                                        • End If
                                                                                        • Set Field [ Syntax Coloring Context Menü Commands::ClipboardContent; MBS( "XML.Colorize"; MBS( "XML.Format"; MBS( "Clipboard.GetFileMakerData"; /* Queries the xml text of a FileMaker layout/script object. */ Syntax Coloring Context Menü Commands::ClipboardGetType) /* The type can be Script, ScriptStep, Layout, CustomFunction, Table, Field or Layout12 "Layout" */ )) ]
                                                                                        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: [GetClipboard]
                                                                                                Script NameMy Colletion of frequently used items
                                                                                                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 [ $Counter; Value:1 ]
                                                                                                    • Set Variable [ $Max; Value:20 ]
                                                                                                    • Loop
                                                                                                    • Set Variable [ $Counter; Value:$Counter + 1 ]
                                                                                                    • Exit Loop If [ $Counter > $Max ]
                                                                                                    • End Loop
                                                                                                    • #---------------------------------------------------------------
                                                                                                    • Set Variable [ $ActivePortalRowNumber; Value:Get(ActivePortalRowNumber) ]
                                                                                                    • Go to Field [ ]
                                                                                                    • Go to Portal Row [ Select; First ]
                                                                                                    • Loop
                                                                                                    • Go to Portal Row [ $ActivePortalRowNumber ] [ Select; No dialog ]
                                                                                                    • Go to Portal Row [ Select; Next; Exit after last ]
                                                                                                    • End Loop
                                                                                                    • #---------------------------------------------------------------
                                                                                                    • Go to Record/Request/Page [ First ]
                                                                                                    • Loop
                                                                                                    • Go to Record/Request/Page [ Next; Exit after last ]
                                                                                                    • End Loop
                                                                                                    • #---------------------------------------------------------------
                                                                                                    • Set Error Capture [ On ]
                                                                                                    • Set Variable [ $Error; Value:Get(LastError) ]
                                                                                                    • Set Variable [ $ErrorDetail; Value:Get(LastExternalErrorDetail) ]
                                                                                                    • If [ $Error > 0 ]
                                                                                                    • Show Custom Dialog [ ]
                                                                                                    • End If
                                                                                                    • #---------------------------------------------------------------
                                                                                                    • Set Variable [ $ScriptParameter; Value:Get(ScriptParameter) ]
                                                                                                    • If [ PatternCount ( $ScriptParameter ; "xx") > 0 ]
                                                                                                    • End If
                                                                                                    • #---------------------------------------------------------------
                                                                                                    • #Encode JSON
                                                                                                    • #---------------------------------------------------------------
                                                                                                    • #Decode JSON
                                                                                                    • #---------------------------------------------------------------
                                                                                                    • Print Setup [ Orientation: Portrait; Paper size: 8,27" x 11,69" ] [ Restore; No dialog ]
                                                                                                    • Print [ Current record; All Pages; Number of copies: 2; collated; Orientation: Portrait; Paper size: 8,26" x 11,69" ] [ Restore: EPSON WP-4525 Series; No dialog ]
                                                                                                    • #---------------------------------------------------------------
                                                                                                    • Set Error Capture [ On ]
                                                                                                    • Enter Find Mode [ ]
                                                                                                    • Set Field [ ]
                                                                                                    • Insert Calculated Result [ ] [ Select ]
                                                                                                    • Perform Find [ ]
                                                                                                    • If [ Get(FoundCount) > 0 ]
                                                                                                    • #Hier die gefundenen verarbeiten
                                                                                                    • End If
                                                                                                    • #---------------------------------------------------------------
                                                                                                    • Show Custom Dialog [ ]
                                                                                                    • If [ Get(LastMessageChoice) = 1 ]
                                                                                                    • End If
                                                                                                    • If [ Get(LastMessageChoice) = 2 ]
                                                                                                    • End If
                                                                                                    • If [ Get(LastMessageChoice) = 3 ]
                                                                                                    • 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

                                                                                                                  Custom Functions

                                                                                                                  Function NameParametersAvailabilityDefinitionIn Field DefinitionsIn Scripts
                                                                                                                  Test_cfInputAll accounts"Nur Test: " & Input

                                                                                                                    Custom Menu Sets

                                                                                                                    Menu SetsMenusIn ScriptsIn LayoutsComments
                                                                                                                    [Standard FileMaker Menus]
                                                                                                                    • All Standard Menus

                                                                                                                    Download example: Script Workspace Context Menu Commands

                                                                                                                    Used functions:




                                                                                                                    Links
                                                                                                                    MBS FileMaker tutorial videos