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

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
Tables 1
Relationships 0
Layouts 1
Scripts 3
Value Lists 3
Custom Functions 1
Custom Menus 24
File Options
Default custom menu set [Standard FileMaker Menus]
When opening file
Minimum allowed version 12.0
Login using Account Name; Account= Admin
Allow user to save password Off
Require iOS passcode Off
Show Sign-in fields Off
Switch to layout Off
Hide all toolbars Off
Script triggers
OnFirstWindowOpen Off
OnLastWindowClose Off
OnWindowOpen Off
OnWindowClose Off
OnFileAVPlayerChange Off
OnWindowTransaction Off
Thumbnail Settings
Generate Thumbnails On; Temporary

 

Tables

Table Name
Statistics
Occurrences in Relationship Graph
Syntax Coloring Context Menü Commands
13 fields defined, 10 records
Syntax Coloring Context Menü Commands

Fields

Table Name: Syntax Coloring Context Menü Commands - 13 Fields
Field Name Type Options Comments On Layouts In Relationships In Scripts In Value Lists
uniqueID Normal, Number Auto-Enter:
  • Serial: Generate: On creation, Next value: 17, Increment: 1
Validation:
  • Only during data entry
Storage:
  • Repetitions: 1
  • Indexing: None
  • Automatically create indexes as needed
  • Index Language: English
          created_TimeStamp Normal, Timestamp Auto-Enter:
          • Creation timestamp
          Validation:
          • Only during data entry
          • Strict validation
          Storage:
          • Repetitions: 1
          • Indexing: All
          • Index Language: English
                  created_AccountName Normal, Text Auto-Enter:
                  • Creation account name
                  Validation:
                  • Only during data entry
                  • Strict validation
                  Storage:
                  • Repetitions: 1
                  • Indexing: All
                  • Index Language: English
                          modified_TimeStamp Normal, Timestamp Auto-Enter:
                          • Modification timestamp
                          • Allow editing
                          Validation:
                          • Only during data entry
                          • Strict validation
                          Storage:
                          • Repetitions: 1
                          • Indexing: All
                          • Index Language: English
                                  modified_AccountName Normal, Text Auto-Enter:
                                  • Modification account name
                                  Validation:
                                  • Only during data entry
                                  • Strict validation
                                  Storage:
                                  • Repetitions: 1
                                  • Indexing: All
                                  • Index Language: English
                                          One Calculated, Number Calculation: Auto-Enter:
                                          • Always evaluate
                                          Storage:
                                          • Repetitions: 1
                                          • Indexing: None
                                          • Automatically create indexes as needed
                                          • Index Language: English
                                                  commandCodeMasterBlock Normal, Text Auto-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
                                                        commandNeedsSelection Normal, Text Auto-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
                                                            commandTitle Normal, Text Auto-Enter:
                                                            • Allow editing
                                                            Validation:
                                                            • Only during data entry
                                                            Storage:
                                                            • Repetitions: 1
                                                            • Indexing: None
                                                            • Automatically create indexes as needed
                                                            • Index Language: English
                                                                ClipboardGetType Normal, Text Auto-Enter:
                                                                • Allow editing
                                                                Validation:
                                                                • Only during data entry
                                                                Storage:
                                                                • Repetitions: 1
                                                                • Indexing: None
                                                                • Automatically create indexes as needed
                                                                • Index Language: English
                                                                    ClipboardContent Normal, Text Auto-Enter:
                                                                    • Allow editing
                                                                    Validation:
                                                                    • Only during data entry
                                                                    Storage:
                                                                    • Repetitions: 1
                                                                    • Indexing: None
                                                                    • Automatically create indexes as needed
                                                                    • Index Language: English
                                                                        commandCodeCalculated Calculated, Text Calculation: Storage:
                                                                        • Repetitions: 1
                                                                        • Indexing: None
                                                                        • Automatically create indexes as needed
                                                                        • Index Language: English
                                                                            Active Normal, Number Auto-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 Properties Coordinates Field Format Field Behavior Quick 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 Properties Coordinates Field Format Field Behavior Quick 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 Properties Coordinates Field Format Field Behavior Quick 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 Properties Coordinates Field Format Field Behavior Quick 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 Properties Coordinates Field Format Field Behavior Quick 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 Properties Coordinates Field Format Field Behavior Quick 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 Properties Coordinates Field Format Field Behavior Quick 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 Properties Coordinates Script/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 Properties Coordinates Script/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 Properties Coordinates Script/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 Properties Coordinates Script/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 Properties Coordinates Script/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 Name Source Values On Layouts
                                                                                NeedSelection Custom
                                                                                • 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
                                                                                GetClipboardTypes Custom
                                                                                • Script, ScriptStep, Layout, ValueList, CustomFunction, Table, Field, Layout12
                                                                                1 Custom
                                                                                • 1

                                                                                Script Hierarchy

                                                                                Install Command
                                                                                GetClipboard
                                                                                My Colletion of frequently used items

                                                                                Next Script: [GetClipboard]
                                                                                Script Name Install Command
                                                                                Run script with full access privileges Off
                                                                                Siri Shortcut Visible Off
                                                                                Include In Menu No
                                                                                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 [ Flush: Always ]
                                                                                • 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 Name GetClipboard
                                                                                      Run script with full access privileges Off
                                                                                      Siri Shortcut Visible Off
                                                                                      Include In Menu No
                                                                                      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 Name My Colletion of frequently used items
                                                                                                Run script with full access privileges Off
                                                                                                Siri Shortcut Visible Off
                                                                                                Include In Menu No
                                                                                                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 [ Flush: Always ]
                                                                                                    • 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 [ Flush: Always ]
                                                                                                    • 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 [ Flush: Always ]
                                                                                                    • 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(LastErrorDetail) ]
                                                                                                    • 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 Name Parameters Availability Definition In Field Definitions In Scripts
                                                                                                                  Test_cf Input All accounts "Nur Test: " & Input

                                                                                                                    Custom Menu Sets

                                                                                                                    Menu Sets Menus In Scripts In Layouts Comments
                                                                                                                    [Standard FileMaker Menus]
                                                                                                                    • All Standard Menus

                                                                                                                    Download example: Script Workspace Context Menu Commands

                                                                                                                    Used functions: