Goodies 6: Search and replace in calculations

Since version 8.0 of our plugin, we have search functions for various text areas in FileMaker.

We add Command-F shortcut to show the find bar in any text view in FileMaker.
Your calculations got long and you can’t find a word? No problem, now you can search for it!

The standard find bar on macOS offers controls to find text in a text view. You may have seen the find bar already in TextEdit application and others. Optional you can enable replace and do replace text in your calculation:

Our plugin adds this great feature for everyone who has the plugin installed. No license required (but appreciated) as this is one of the many free features included with MBS FileMaker Plugin. You can turn the feature on and off in our preferences dialog or using SyntaxColoring.SetAddFindbars function.

Here is a calculation dialog with the find bar:

In general this works for every text view in FileMaker. In custom functions window we saw redraw issues with focus ring, but that doesn’t change functionality, so please ignore the blue lines. When working right, it looks like this:

Like all our additions to the FileMaker Development tool, we use very defensive programming techniques. The plugin registers the command-F shortcut here. If FileMaker ever itself needs Command-F, FileMaker comes first, so the plugin would no longer get the key press event. When we get it, we check if focus is on a text view, so for any other control, we just exit. Finally we check if there is a find bar, so if FileMaker ever starts registering one with the text view, we exit and don’t do anything.

Another little thing added with the Command-F is the Command-Option-C shortcut to copy the formatted text of the calculation. This helps to copy calculations and paste them in a forum or on a blog.

Shortcuts for calculation editor
⌘ Rshows rulers.
⌘ Ishows invisible characters
⌘ Fshows find bar and go to find.
⌘ ⇧ Fshows find bar and go to replace.
⌘ Ggoes to next found text.
⌘ ⇧ Ggoes to previous found text (new in v14.0)
⌘ [reduce indention of text.
⌘ ]indent text to right.
⌘ Ccopy as text.
⌘ ⌥ Ccopy as styled text.
⌘ ⌥ ⇧ Ccopy as html text.

Copy text 6 Relationship Graph Search