In this article I want to introduce you the new functions from the MBS FileMaker Plugin in version 10.3.
Let's start with a few innovations with LibXL, that allows you to edit Excel files. You now have functions with which you can identify the area of the table where data is filled in. You can determine the first row or column in an existing Excel document and which one is the last row or column that is filled. This simplifies your work. For example, you want to enter data in an existing table. You first determine the last filled row and then you enter the new values in the next row
There is the new XL.Sheet.CellWriteTextAsNumber function that writes a number into an Excel spreadsheet, which is passed as text. This prevents rounding errors for decimal numbers
The Audit component can log changes in a database. Under the new Filemaker Pro, we create fields for each table that make this logging possible. With the new function Audit.SetIgnoreRepetitions you can set whether repeating fields should be checked. If you want to know if the check is deactivated, you can use the appropriate Get function Audit.GetIgnoreRepetitions.
Let's take a look at the new features in the GraphicsMagick component. With the new ping functions, GMImage.Ping and GMImage.PingContainer we can load image data from a file or container field. Ping is similar to functions that read the data, but we read only enough to determine the image columns, rows, and file size. That means we can only read the metadata.
Another function, GMImage.GetZPL, returns the hexadecimal ZPL value for an image. The picture is taken as black & white image and build the hex string, you can send this hex string to a receipt printer, which generates an image with this hex sting and prints it out.
In the Files component we have added a very powerful function that standardizes the path for you. For example, you have got back the following path from an application under Windows: %HOMEPATH%\test.txt. This is converted with the function Files.StandardizePath into the standardized path C:\Users\Name\test.txt
Under MacOS the tilde is extended. The empty components, references to the current directory and symbolic links are reduced.
On Windows we resolve environment variables and get the full path.
For Linux, symbolic links are resolved, empty components are reduced and relative paths are resolved.
We have a new function for the hotkeys on Windows and Mac. With HotKey.UnregisterAll you can unregister all Hotkeys. This enables you to reset the complete assignment of the hotkeys instead of having to do this with HotKey.Unregister for each hotkey individually.
The Matrix component also has a new function. You can use the function Matrix.Multiply to multiply a specific value to the whole matrix or only to a specific part. The individual values of the matrix are then multiplied by a fixed value.
For positioning the AV Recorder preview we have a new function for you, the AVRecorder.AddPreviewWithControl function. You can now place the AV Recorder on a layout by using a control as a placeholder. You can place a rectangle with the name Placeholder in your layout. The function call can then look like this:
MBS("AVRecorder.AddPreviewWithControl"; $$AVRecSession; Get(WindowName); "Placeholder")
Once created, the AV Recorder preview object is in the foreground and is not affected by record and layout changes.
For the CURL component, seven functions are added, which we can use to set additional options for SSL certificates.
On one hand you can make settings to the issuer SSL certificate, so that you can transfer the certificate as a Blob and certificate filename. With this options we have an additional check against the peer certificate to verify the issuer is indeed the one associated with the certificate provided by the options. This additional check is useful in multi-level PKI where one needs to enforce that the peer certificate is from a specific branch of the tree.
On the other hand, we have four functions that can specify for the client or the proxy the SSL certificate as a memory blob and the private key.
We have two new functions in the Shell component that allow us to request (Shell.GetBufferSize) and change the buffer size (Shell.SetBufferSize). You should first create a new shell object with Shell.New before you change the buffer size. Only afterwards you should execute an application. On Linux the buffer is set to 64K by default and on Windows to 4K by default. On Mac this setting is ignored, because the buffer size is dynamic.
With the new function SSH.Tunnel.GetConnected you can check whether the tunnel is connected and transfers data.
With Socket.EnableKeepAlive we get a function to avoid TCP/IP timeouts. Once enabled, the computer will regularly send an alive message to the other side, so the TCP/IP socket keep alive.
For a X509 certificate you can now query the X509.ValidNotBefore function for the creation time of the certificate and thus the beginning of its validity. With the new function X509.ValidNotAfter you can query the expiry date. Both times are given in Greenwich Mean Time
CLibrary and CFunction
With our new Component CFunction you can load shared libraries written in C/C++ and list their functions. You pick a function and use the CFunction functions to prepare a call and then run the function. Parameters are automatically converted to the right datatypes and the result converted to a value for FileMaker. This function allows to directly call various functions of the OS directly as well as device SDKs with their interface libraries.
For the component JAVA we have two new functions. With the Java.DefineClass you can dynamically declare a class with loading data from a container. In the first parameter you define the class name and in the second parameter you define the container with the class data. With the also new function Java.FindClass we check whether a class is loaded and in this way available. In the parameters we pass the class name.
We have two different new functions for the component JSON. One is the function JSON.GetBooleanValue which returns a boolean value. It returns 1 for true values, numbers which are not zero and for texts which are either "1" or "true".
Otherwise returns 0. With the second function we can convert a given JSON into a XML. This function is called JSON.ToXML. Since version 8.2 there is already the function XML.ToJSON which converts XML into JSON.
But not only for the new functions of the JSON component XML is important, you can also query your database with SQL and receive the result in XML format. Depending on whether the result consists of one or more data records, the new functions FM.SQL.XMLRecord and FM.SQL.XMLRecords are available.
Now we come to the new functions of the Web Viewer. In the parameters of the functions WebView.Create and WebView.CreateWithControl you can decide which version of the Web Viewer you want to use. If you want to check which version an existing Web Viewer has, you can query this version with the function WebView.Version. With the function WebView.CreateWithControl you create a web View with the help of a control, for example a rectangle, in the layout. The call of this function could look like this: MBS( "WebView.CreateWithControl"; "0"; "Placeholder"; 2)
First we specify the window in which the WebViewer is displayed, followed by the name of the control on which the WebViewer is positioned and optionally the version of the Web Viewer. The return value is the reference of the Web Viewer. We can also align an already existing Web Viewer with a control using the WebView.SetFrameWithControl function
For Windows you can show a Debug bar for the Web Viewer. With Debug
Bar you can inspect HTML elements, see scripts and modify elements on the fly.
If you want to use the DebugBar you can download it on "www.debugbar.com".
You may need a separate license to use all features.
There are also new functions for Mac users in the ColorPanel component. First, you can set and query the alpha component of a color via script. The functions ColorPanel.GetAlpha and ColorPanel.GetColorName are available for this. The alpha component of a color determines to its transparency. With another new function, ColorPanel.GetColorName, you can query the name of the current color and display it e.g. in a field next to a container with a color image.
For Mac users there is now a completely new component, the SharingService component. With this component you can share items and pass them to Air Drop, Mail, Messages, iPhoto, and more applications.
This function, which Mac users already know from many applications, can also be integrated into your FileMaker solutions. For mails and Messanger for example you can use the functions SharingService.SetEmailRecipients and SharingService.SetEmailSubject to specify the list of recipients and the subject. With SharingService.ShareItems we can activate sharing. In the parameters we specify which service we want to use. If there are several services, a context menu will appear where we can choose with which application we want to share the content. In another parameter we specify which fields should be shared, e.g. a container with an image, a text field with an URL or a simple text. Empty fields are ignored. If we share content we activate a script trigger that we can define with the function SharingService.SetTrigger. For example, you can check whether a message was sent or the process was aborted and then return a dialog box that matches
Apple has announced that they will change their Intel-based processors completely to Apple's own Apple Silicon processors within the next 2 years. Apple's own processors are already integrated in iOS devices. Of course we are working on the plugin to prepare for this change. In the new version we already have a few functions that can be useful in connection with the new chips. So we can check with SystemInfo.isARM whether the processor is an ARM processor. The function returns 0 for ARM processors. For Apple Silicon or iOS devices we get 1 as result.
With the function SystemInfo.isBigSur we check whether the used operating system is macOS 11 Big Sur or higher.
The new function SystemInfo.isTranslated indicates if the application has already been translated to Intel code or if it is a native ARM application.
Please do not hesitate to contact us with your questions.
by Stefanie Juchmes