« Xojo Workshop in UK | Home | New in the MBS Xojo P… »

New in the MBS FileMaker Plugin 10.0

In this article I want to show you what’s new in the MBS FileMaker Plugin version 10.0. Year! We reach the 10 in front of the dot. With a new Year and a new plugin version we get a lot of new functionalities.

List and QuickList comprehension

At fist I want to show you the new functions to compare specified columns of lists and quick lists. The difference between a list and a quick list is, that a quick list is a reference to a list object managed by MBS Plugin instead of just a block of text passed around.

Now you can compare listen entries in a specified column from two lists. You can filter the list items that are in both lists (List.AndColumn), List items from the first list that don’t find a match on the second list (List.NotColumn), list elements of both lists where entries that occur in both lists are only mentioned once (List.OrColumn) or list elements that’s are only on one list (List.XOrColumn). The functions are similar for quick lists. Here is an example for the use of it.

You plan a business meeting and have a list with first name last name and ID from the invited persons and a list of the registered persons for this meeting. Now you can compare the lists. A entry in this list looks like that: Mary-Flora-189

Set Variable [ $ListAND ; Value: MBS( "List.AndColumn"; $List1; $List2; "-"; 2 ) ]
Set Variable [ $ListNOT ; Value: MBS( "List.NotColumn"; $List1; $List2; "-"; 2 ) ]
Set Variable [ $ListOR ; Value: MBS( "List.OrColumn"; $List1; $List2; "-"; 2 ) ]
Set Variable [ $ListXOR ; Value: MBS( "List.XOrColumn"; $List1; $List2; "-"; 2 ) ]


The result of the comprehensions looks like that the dialog on the side.

News from CURL
We have new functions for CURL connections. Now you can test and set how many connections can run per server. For that you can use the “CURL.SetMultiOptionMaxConcurrentStreams” and “CURL.GetMultiOptionMaxConcurrentStreams” function. In addition you can query the result of the CURL transfer and parses as MIME data. MIME is an extension of the mail format that supports text in other character sets than ASCII as well. It may be used in a web service to return multiple documents, e.g. JSON and a PDF document. see CURL.GetResultAsMime function.
Additionally we update CURL to 7.67.0.

Shell
For the run of command line tools we also have some new functions for setting and getting script triggers and expression that should evaluate when data is available. This way you can set a script trigger for the shell. Similar functions allowing you to set a script or an evaluation to run when the shell is done, exist since MBS Plugin version 7.5.

DynaPDF
Using newer functions you can define go-to actions by a named destination (“DynaPDF.CreateGoToActionEx”) or by a page number (“DynaPDF.CreateGoToAction”). The targets can also be located in other PDF files (“DynaPDF.CreateGoToRAction” and “DynaPDF.CreateGoToRActionEx”) in this case you must set the target file path in the parameters. You link the action e.g. to a cell in a table, so the action runs when people click on the cell.

With the new function “DynaPDF.FlattenAnnotOrField” we can draw an annotation or form field on an open page. Moreover we update DynaPDF to version 4.0.37.101

JSON
We develop a new function JSON.EqualContent to check whether the content of two JSON is equal. In comparison to the “JSON.Equals” function, the new function check the structure and the value in the single nodes. “JSON.Equals” checks the type of a value and the value, so both must match. Because that MBS( "JSON.EqualContent"; "\"123\""; “123") returns 1 and MBS("JSON.Equals"; "\"123\""; "123" ) returns 0.

JavaScript without WebViewer
We are happy to present you a new component, which you can use to extend the functionalities of FileMaker by yourself, the component JavaScript. With the functions in this component you can execute JavaScript without a web viewer. You create your own JavaScript environment, add and call functions, set and get global properties and execute JavaScript code. With this component you can combine the power of JavaScript and the GUI of FileMaker. It also is a method to speed up some FileMaker processes.

To give you an example of how to use the function, we want to write a function that add a numeric value to a global JavaScript variable the code. The global variable is set, before we add the function. A Script in FileMaker look like this:

Set Variable [ $js ; Value: MBS("JS.New") ]
Set Variable [ $r ; Value: MBS( "JS.SetGlobalProperty"; $js; "A"; 2 ) ]
Set Variable [ $r ; Value: MBS( "JS.AddFunction"; $js; "AddNumberToVariableA"; "function (x) { return A+x; }" ) ]
Set Variable [ $result ; Value: MBS("JS.CallFunction";$js;"AddNumberToVariableA"; 3) ]


We create a new JavaScript environment named $js and set a global property A with value 2. Then we write the function with the name “AddNumberToVariableA” and call this function in the next step. After we execute that script, $result variable is 5.

Specially for Windows
We have also new functions specially for Windows users like Evaluate and WMFP functions:

The Call and Evaluate function in the WebViewer
Appropriate to the last section about JavaScript, I introduce you now functions that execute a JavaScript functions and code in the WebViewer on Windows. The first function is called "WebView.CallFunction". In the parameters you enter the WebViewer reference, the name of the function that should called and at last its parameters.The second function which is also compatible to Mac and iOS is the "WebView.Evaluate" function. With this function a JavaScript expression can be executed in the WebViewer. The return value is the result of this expression.
This is a major improvement compared to WebView.RunJavaScript function, which never returned the result on Windows.

The new WMFP component
The plugin supply with WMFP component new video player functions for Windows. With this component you can play video and audio in the background of your application independent of a container. For this we use internally the Windows Media Foundation Player. We can create a new player with the source file path. Then we can play the audio/video, stop it, mute it, pause it, set the speed and volume etc. For a video it is useful that we can set the position and size of the video. Please take a look to this multifaceted component.

MacOS
For the Mac users we have also some new functions:

Control FileMaker
With the new functions in the SyntaxColoring and the ScriptWorkspace component you can adapt FileMaker better to your needs. With the syntax coloring you can query and set whether Formulas can include links or you can list all ContextMenuCommands. With the new script workspace functions you can query and set the text of the script list search, query the current selected line as a line number, or check if the script workspace window is on focus.

Append Text
As well we add two functions to the RichText component. Both functions are appending text to a file. The “RichText.AppendText” appended simple text to a file. The “RichText.AppendFormattedText” function appends new styled text to the document. The text you can set in the parameters can have style informations like you see in this script

Set Variable [ $r ; Value: MBS( "RichText.SetFormattedText"; "Dear Susan, ¶" ) ]
Set Variable [ $r ; Value: MBS( "RichText.AppendFormattedText"; TextColor ( TextFont ( TextSize ( "Hallo World!" ; 30 ) ; "Noteworthy" ) ; RGB ( 255 ; 0 ; 0 ) )) ]
Set Field [ Test::Output text ; MBS( "RichText.FormattedText" ) ]


Files copy
Also new ist our “Files.CopyFiles” function. With this function it is possible to copy multiple files at the same time. For example you want to copy all files from folder A to folder B. The function “Files.ListRecursive” gives us the paths of the files in the folder in a list. With "Files.List" we get the filenames with the suffix as a list. To copy the file we need a list of source file paths and a list of traget file paths. With the filename list we create our target paths by placing the folder's destination path in front of them. This we do at a loop and using the following script step.

Set Variable [ $target; Value: $target & "/Users/sj/Desktop/B/" & MiddleValues( $list; $i ;1) ]

When we exit the loop in the variable $Source we have the Source paths as a list and in the variable $target we have a list of the target paths. With the script step
Set Variable [ $r ; Value: MBS("Files.CopyFiles"; $Source; $target;1) ] we copy the files. If we set the 1 at the parameters we overwrite files in the source folder that have the same name.

CoreML
Furthermore we have add a very useful function to the CoreML component. With the function “CoreML.Update” you can update the machine learning model on a user device. That trains the machine learning model with new data. The training data is passed as a JSON array. Each entry is an object with input and output keys. In the keys are the informations that you need for the training. That function gives you the possibility to train your own Machine Learning model in the way you want it.

iOS

EIDSDK
The new component EIDSDK supplies functions to read eID cards with the zetes bluetooth card reader on your iOS device. In this way you can read informations on a Belgium ID card. You can set script triggers for finding and lost the connection to a reader or for a found or gone card. To example if a card was found, you can read out the name and the picture of the person to whom this card belongs. That informations you can see on your iPhone.

The new DocumentCameraScan component
Also new is the DocumentCameraScan component. With the functions from this component you can scan documents with your iPhone directly to your FileMaker application. At first you initialize the document camera functions and set the script trigger to a script. This script is calling, when we finish the document scan. In this script you can save and handle the informations. The scanned document consists of single images of the pages. For example if you scan a text document you can extract the text of each page with OCR.

If you want to scan a new document you call the function “DocumentCameraScan.Scan”. This shows the scan dialog. In the Scan dialog you can detect a page automatically or set the edge Points of the document by hand. The document is automatically straightened and you can choose if you want to scan one page more.

This functions are similar to the Continuity Camara functionality but you can work directly with the scans on your iOS device. If you want to scan documents with your iOS device and want to work on your Mac with this scan. The component ContinuityCamera would be interesting for you.

I hope you finde some interesting functions for your project. If you need a license of the MBS FileMaker Plugin or have questions, please visit our website or contact us. Have a lot of fun with the new functions!
by Stefanie Juchmes
23 01 20 - 11:29