As you may know we have a feature where you can add new contextual menu commands to the Script Workspace with our SyntaxColoring.AddContextMenuCommand function. The custom commands can edit script lines, paste some template code or do whatever you like. Read more here Goodies 33: Custom context menu commands and Adding ChatGPT to the ScriptWorkspace context menu
For the next MBS FileMaker Plugin version 14.6 we add the possibility to do the same for the contextual menus in Layout and Browse mode for FileMaker. Just call SyntaxColoring.AddContextMenuCommand with the new flags 16 for browse mode and 32 for layout mode. The plugin will show your custom commands and run whatever you pass as expression if the user selects them. And as usual we store them in the preferences file, so they presist.
Example
A sample call may be as easy as this one:
MBS( "SyntaxColoring.AddContextMenuCommand"; "Greeting"; "MBS("Msgbox"; "Hello World")"; 16 )
This will evaluate the expression and thus call our Msgbox function in the MBS FileMaker Plugin. The expression may include window functions to act on the current window or trigger scripts with FM.RunScript function.
What could you use this for in Layout mode?
- Insert snippets for common used layout elements.
- Copy current selection, modify it and paste back.
- Copy current selection and pass to AI functions like ChatGPT.
- Apply a style change to the current selection.
What could you use this for in Browse mode?
- Trigger scripts from the context menu.
- Exclude current record from result set.
- Start a search.
- Change the window by offering options to move and resize the window.
- Add a print command.
We look forward what the community comes up with. You may have your own file to install a few common used things for yourself.