In this article I want to introduce you the new functions from the MBS FileMaker Plugin in version 10.5.
XL - Working with Excel
Let's start with the innovations in the XL topic. With our plugin you can create and edit Excel documents via FileMaker scripts. Also in this release we have new features that extend the functionality of this topic. With the new function XL.CopyColumn you can copy the values of a column of a table into another column. This copying process is not limited to the worksheet or book. You can also copy columns between different books and sheets. These must then be defined in the parameters.
You can use the XL.Sheet.AddDataValidation function to perform data validation for a specific area of a table. For example, you can specify that a column may not be empty or the values are in a range. These data validations can then be removed with XL.Sheet.RemoveDataValidations. This functions works for xlsx files.
The last but not least new function in the component is the XL.Sheet.CellReadValue function. With this function you reads a value from a cell. Depending on the content we return a number, a boolean, a text or a timestamp. Empty, blank or error cells will return an empty value.
CSV Matrix
Another new function is the Matrix.CSVSplit function. With this function we can convert a Comma Separate Value Text into a matrix. For example, if you have the data of a FileMaker database as a CSV file, you can use this function to easily write the data into a matrix and work with it.
List and Quick List
The List and QuickList components get also a new function. With List.FindDuplicateItems and QuickList.FindDuplicateItems we can find duplicate items in the lists. As Return we get a list of the duplicates, but only counts each one once.
Release All
In the MBS FileMaker Plugin there are some topics where we work with objects in memory. Be it a DynaPDF working environment or an image from the GraphicsMagick component. We have to release these objects after they are no longer needed to avoid that they limit the main memory. Up to now it was often only possible to release working environments individually. When we had to free multiple objects it could lead to a lot of writing. In the plugin version 10.5 we have therefore implemented many functions with which you can free all working environments of the appropriate type at once. To give you an overview of the areas for which the ReleaseAll function is available now, here is a list:
- AVExport.ReleaseAll
- AVRecorder.ReleaseAll
- CFunction.ReleaseAll
- CGImageSource.ReleaseAll
- CLibrary.ReleaseAll
- CoreML.ReleaseAll
- DNSLookup.ReleaseAll
- Dictionary.ReleaseAll
- DynaPDF.ReleaseAll
- ECKey.ReleaseAll
- FM.SQL.ReleaseAll
- FSEvents.ReleaseAll
- JS.ReleaseAll
- JavaScript.ReleaseAll
- LDAP.ReleaseAll
- MarkDown.ReleaseAll
- Matrix.ReleaseAll
- MenuItem.ReleaseAll
- PDFKit.ReleaseAll
- PKCS12.ReleaseAll
- PKCS7.ReleaseAll
- PKey.ReleaseAll
- SSH.ReleaseAll
- SendMail.ReleaseAll
- Shell.ReleaseAll
- SmartCard.ReleaseAll
- TouchBar.ReleaseAll
- UserNotification.ReleaseAll
- WMFP.ReleaseAll
- WMIQuery.ReleaseAll
- WinSendMail.ReleaseAll
- WindowsML.ReleaseAll
- WindowsUserNotification.ReleaseAll
- WordFile.ReleaseAll
- X509.ReleaseAll
Function Platforms
If you want to know which platform a MBS function is running on, you can use the new function "Plugin.GetFunctionPlatforms" to check the platform compatibility. As an answer you will get a string with letters. The letter W stands for Windows, M for Mac, L for Linux and I for the iOS SDK. So if you would execute the following line in your script, $r would contain the result: WMLI Set Variable [ $r ; Value: MBS( "Plugin.GetFunctionPlatforms"; "Archive.Extract") ] Because the function Archive.Extract is avidable for all platforms
DynaPDF
We have some new features in the topic DynaPDF. On Windows you can now use collate and sorting options for printing with DynaPDF.Print function:
There are two new functions for barcode handling under DynaPDF. With the function DynaPDF.InsertBarcode we can create a barcode on the active page. In the parameters we then specify the properties of the barcode as JSON. For example, we can define the content, the position and the size. Here we see how such a JSON can look like.
Set Variable [ $rt ; Value: MBS( "DynaPDF.InsertBarcode"; $PDF; „ { "BarcodeType": "QRCode", "Data": "Hello World", "PosX": 100, "PosY": 100, "Width": 50, "Height": 50 } " ) ]
The advantage of using this function is that the barcode is generated directly in the PDF and is therefore not pixelated, as it would be the case with a barcode as an image. How the default settings are, when inserting a barcode, is received by the DynaPDF.GetDefaultBarcodeParameters function. It returns a JSON with the default settings as JSON. We can then use the JSON functions to change parameters in the returned JSON and pass them to the DynaPDF.InsertBarcode function.
The new function DynaPDF.GetDescent returns the descender of the active font. The descender is a typographic value that specifies the maximum extent to which characters in the active font descend below the baseline. The descender is normally a negative value. In this function it is always returned as a positive value to make the usage easier.
We also have a new function that creates a symmetrical polygon. To do this, you specify the position of the center, the radius, the rotation angle, the number of sides and the fill mode in the parameters of the DynaPDF.DrawNGonfunction. The minimum number of sides is three.