Goodies 1: Script Coloring

The MBS Plugin has a default rule set to color script lines and overwrite the colors from FileMaker itself. This includes the use of red color for lines with errors, orange for warnings and colors to detect the type of lines.


In the screenshot you see Perform Script in red as no script is chosen. You also see Set Field without field specified in orange.

And the best: You can customize the rules with the fmSyntaxColorizer database included with the plugin. Thanks to Russel to make it.

If you select a line belonging to an if or loop block, we highlight the other lines for the same block in light blue. This way you can easily spot where the end if/loop lines are or where the loop is exited early.

Features

We color different scripts steps differently. One color for standard script steps, but a different color for flow control script steps (blue). Then a color for interactive steps and other colors defined for specific scripts steps.

To find problems in the code, we highlight scripts steps with missing parameters in a different color, e.g. "Set Field []" in orange instead of black and "Else If []" in red instead of blue for the missing condition. Then we have wild card rules to find lines containing text like "<Field Missing>" and show them in red.

Comment lines get a color. But comments starting with specific prefixes like #FIXME, #TODO, #TEST or #BUG get different colors.

The plugin comes with a default set of colors for light and dark mode, but you can customize them yourself with calls to SyntaxColoring.AddTag function or using a GUI like the fmSyntaxColorizer database included with the plugin.

If/Loop highlighting

We added block highlighting in version 6.1 of MBS Plugin:


For FileMaker 14 and newer & Mac only. You can turn it on or off via preferences dialog or SyntaxColoring.ScriptIfLoopHighlight.SetEnabled function.

Dark Mode

Since MBS FileMaker Plugin 10.3 we tuned our dark mode support for FileMaker. While Filemaker's Script Workspace comes with some syntax highlighting features built-in, our MBS FileMaker Plugin can add more for macOS users:

On the left is pure FileMaker and on the right side is with MBS FileMaker Plugin. Below in light mode:

You may notice that our plugin applies coloring rules, e.g. to highlight broken script lines in red. The plugin colors comments based on tags, highlights blocks and shows errors for undefined variables being used.

If you run in the screens below, the colors are not right and you should reset them:

In FileMaker Pro, please go to the Script Workspace Preferences dialog via view menu and press the reset button. You may need to do this whenever you switch between dark and light mode.

The MBS FileMaker Plugin rules can be reset at anytime with running MBS( "SyntaxColoring.FactoryDefaults" ) function via data viewer or script. This installs the default rule sets for light and dark mode. If you have custom color rules, you may need to install them again. And if you use fmSyntaxColorizer or another database to manage rules for syntax colorization, please go there to apply your rules again.

The syntax coloring features are provided by MBS FileMaker Plugin for free on macOS to all FileMaker users installing the plugin. We still appreciated if you buy a license and use all the other 7000 functions.

They can be configured via preferences dialog or our SyntaxColoring function set.


  1 Calculation Coloring