Search all scripts with MBS Plugin

There is a new feature in development for MBS Plugin and you can see it 16.0pr6 (see announcement here). We add the possibility to search in all scripts in the script workspace and find things.

For this we add a new search button (magnifier glass) to the toolbar on macOS on the right:

As well as on Windows with a regular button:

We even got a fancy tooltip to explain the button.

When you click the button, we take a snapshot of the current scripts in the window. Then we open a search window and pass the scripts. This may take a few seconds (or a minute for huge databases). Once the snapshot is loaded in the search window, you can start searching:

As you see we show you results as you type and highlight the found text. We show the script name (optionally with group name), the line number and what step this is.

When you make changes to the script, the snapshots ages. You may decide at any time to close the search window and open a new one.

On the Mac we can actually control the Script Workspace. You can click on the search result and we find the script (by name) and open it on the given line. There is a little chance that you have two scripts with the same name and this won't pick the right one.

You can have multiple search windows open. All the script data is held only in memory and you can only search the scripts where FileMaker allows you to see the content, so no worries for security. In case you close the Script Workspace, we close the related search windows. Use SyntaxColoring.ScriptSearchButton.SetEnabled function to enable or disable this or the checkbox in the preferences dialog.

Please try the feature and please give us feedback. Anything it doesn't find?

3 Likes

As I already wrote in the German FM Forum: this feature is simply fantastic!

1 Like

Will clicking any of these take you to the script?

Can you search by RegEx?

How about exporting search results?

This is the first version. More is to come.

Multiple words work, but no regex and no export.

On macOS a click brings you to the line in the script. On Windows it can’t.

2 Likes

Verstanden.

It’s great that the currently (IMHO) overpriced third-party search tools will finally have some competition!

And…”Replace”

And…”Print”

1 Like

Brilliant Christian, good replacement for 2empowerFM plugin and blazing fast.
Makes this years update very worthwhile. It would be helpful if Paste works in the searchbox.

1 Like

It’ll take a few versions to unseat 2empowerFM, but it’s a start in that direction. What I like about the 2EmPower plug in is that it runs standalone and is fully featured. I would reasonably expect Christian to have several versions to fully catch up to that tool.

Finally having some competition in these overpriced-but-basic search/other FMP tools (that cost more than I paid for FMP itself!) is refreshing and I am totally with Christian on this!

Well, the version 16 is set. I already collect what people wish for in future releases.

We’ll see what the feedback is and then add more over time.

1 Like

It’s all good. We’re all behind you!!! :grinning_face:

Everyone can now use it with the 16.0 release.

1 Like

Game changer! MBS just keeps getting better and better. Honestly the features you are adding to enhance efficiency and productivity for developers is far beyond anything Claris has done in recent memory

2 Likes

Claris is busy implementing features nobody wants or needs instead of making the product more usable. I commend MBS for filling this obvious need. Thanks Christian!

2 Likes

Christian, when are you finally going to launch your own database app? I think there are a lot of customers waiting for it. So be prepared for your bank account to be closed due to overload.:grinning_face: .

Well, there are still a ton of things Claris could do, that I can't do.

Like horizontal portals. You know, a checkbox in the settings and a few branches in the rendering engine for building the layouts.

But I fear the layout engine is already so complex, that doing this would break something else.
Maybe I should someday apply for an internship at Claris and take a sneak peak on the code.

1 Like

Hey Christian,

Can your new search scripts plug-in detect when there is a variable not defined error (“not found!”)? The current search tools do not seem to be able to detect this.

Consider a Create Variable script step where you assign a value, like “$size”, to a global variable like $$size where “$size” was not initialized and does not exist.

FileMaker detects this error, but search tools don’t seem to be able to find it.

Thanks

Well, the new search window is based of the XML of the scripts.
We'd need functions to run through the XML and do the same variable check as in the script workspace window.

I am not opposed to this, but it may be a lot of work.
If someone has an idea how to process FileMaker Script XML in JavaScript to find them, please volunteer. I could add a couple of utility script into the window as tools window. Then run various JavaScript functions to examine.

2 Likes

I have some JavaScript which is possibly around 60-75% of what might be needed for this.

I have been meaning to revisit this code to see if I could shape it into tools similar to what is being described here. I was planning to set aside some time for this starting in a month or two. Given the incentive of this thread, I will try to take that intent a little more seriously.

@MonkeybreadSoftware : If I were to write a small JS library with some helpful utilities specific to examining the FMP script XML, do I understand correctly that you might be able to expose functions from such a library for users of your plugin to apply?

Also, since there are various flavors of FM XML, I would want to make sure I am on the correct page, here. Would this be the XML from a copy/paste operation? Or DDR XML? or Save As XML / add-on XML? or something else?

This sounds like it could be fun, and if there is the potential for creating something really useful for the FM community, I'm pretty sure I would be interested in giving it a try to make it happen.

1 Like

Select a script in the script list and copy it.
Then take that XML from the clipboard and try it on the JavaScript.

I could add some buttons to the search window to do analyzes.

be aware, that on the long run the copy & paste XML will change to the one used in Save as XML if I remember some presentation correctly.

1 Like

When I copy the script using MBS, the FMP error text in red isn’t copied with the script text.

Text below in red in FMP script. Does not copy. Thus, I can currently not find these kinds of issues.

Set Variable [$$size ; Value: $size + <field_redacted> $size not found!

Sure, this text is only shown by MBS Plugin when we do our variable check.

The JavaScript would need to find this itself.