In this article we want to introduce you the new functions from the MBS FileMaker Plugin in version 15.2.
LibXL
Let's start with what's new in the LibXL component. LibXL supports you since years in creating, reading and modifying Excel files. In this release you get the possibility to add and format tables. First, we can add a table with the XL.Sheet.AddTable function. You can give this table a name, a range and a style. You can change the name and style later using the other functions we have added. To change the name, we use the XL.Table.SetName function. To change the style, use the XL.Table.SetStyle function. You can find out which styles you can use here (LibXL: Table class reference).
Now we can decide whether we want to apply the formatting to the colum and row stripes. With the functions XL.Table.SetShowLastColumn and XL.Table.SetShowFirstColumn you can decide whether the first and last row should have the style applied. If you want to know how many columns are in your table, use the XL.Table.ColumnSize function.
ListDialog
We also have some new functions for the ListDialog. You can now also assign a value to the various buttons, which can then be used in a script to differentiate between cases, for example. To set this value, use the functions ListDialog.SetCancelButtonValue, ListDialog.SetOtherButtonValue and ListDialog.SetSelectButtonValue. You then have the corresponding counter functions to query these values: ListDialog.GetCancelButtonValue, ListDialog.GetOtherButtonValue and ListDialog.GetSelectButtonValue. In the list dialog, you can also press the Cancel button if you have not made a selection. With the Select button, you always need a selection to be able to use it. With the OtherButton button, you can now use the ListDialog.SetOtherButtonNeedsSelection function to decide for yourself whether or not a selection must be made when using this button. By default Mac shows Cancel left and OK right. On Windows it is reversed and OK is left and Cancel right. So that you can standardize this, we now provide you with the ListDialog.SetSwapButtons function that can swap these buttons.
DynaPDF
DynaPDF also has new functions for you in this release. The function DynaPDF.ReadImageFormatFile retrieves the most important properties of an image file. It reads only the image header to improve processing speed. The horizontal and vertical resolution of an image file retrieves the DynaPDF.ReadImageResolutionFile function. Rendering text in a PDF file may seem straightforward - until you try to work with languages like Arabic or Hebrew. These languages require more than just placing characters from left to right. Without proper handling, the result can be unreadable or even misleading. Arabic, like many other languages, has context-sensitive glyph shaping. The shape of a character can change depending on whether it appears at the beginning, middle or end of a word. In addition, the text goes from right to left, which adds more complexity. To deal with this, DynaPDF offers the bidi mode. When enabled, this mode uses the Unicode Bidirectional Algorithm, as defined by the Unicode Consortium, to determine how to correctly arrange characters in a mixed left-to-right (LTR) and right-to-left (RTL) context. You can now set and query this BidiMode with the functions DynaPDF.SetBidiMode and DynaPDF.GetBidiMode. For more information on this topic, please read our blog article Bidirectional Mode and Complex Text Rendering in DynaPDF
We also have a new function: DynaPDF.RenderJob. It Renders PDF pages in the background. This function allows you to specify a JSON with the job and run it in background in FileMaker Pro or synchronously in FileMaker Server. For synchronous mode, we return a JSON and otherwise pass it to the script triggered as parameter. We can specify the document to be rendered either as a container in the function or as a file path in our JSON. In the JSON you can also specify many other settings, such as a password to open the PDF document or the resolution, height and width. As always, you can find further information on these options in the DynaPDF.RenderJob function documentation.
Variable
With the MBS FileMaker Plugin you have the option to managed global variables preserving the data type. We have new functions for you in this area. Variables can contain lists of values. To check how many values there are, we have the new function Variable.ValueCount. To add a value to this list in the variable, you can use the Variable.AppendValue function. If you want to read the last value from the list and then remove it , use the Variable.PopValue function.
You can also have a JSON array in such a variable. If you want to add to this, use the Variable.AppendJSON function. There is also a suitable Variable.PopJSON function for JSON arrays.
CURL
This time we also have two new functions for the CURL area. The function CURL.SetOptionTCPKeepCount sets the number of probes to send before dropping the connection. So it is the maximum number of TCP keep-alive probes.
With the new function CURL.SetOptionUploadFlags you can set flags in connection with the upload of emails via IMAP. The current supported flags, to send the server relating to uploaded files are:
Code | Description |
---|---|
Answered (1) | which sets the Answered flag for IMAP uploads |
Deleted (2) | which sets the Deleted flag for IMAP uploads |
Draft (4) | which sets the Draft flag for IMAP uploads |
Flagged (8) | which sets the Flagged flag for IMAP uploads |
Seen (16) | which sets the Seen flag for IMAP uploadsJSON |
JSON
We have also included a new function for JSON in this release. With the JSON.ToCSV function, you can convert a JSON into a CSV. This can then look like this, for example:
MBS( "JSON.ToCSV"; "[ {"name": "Seattle", "state": "WA"}, {"name": "New York", "state": "NY"}, {"name": "Bellevue", "state": "WA"}, {"name": "Olympia", "state": "WA"} ]“)
Python
We also have new functions in Python. These can provide us with a little more information about the library we are using. The function Python.LibraryBuildInfo return information about the sequence number and build date and time of the current Python interpreter instance. To get an indication of the compiler used to build the current Python version we use the Function Python.LibraryCompiler. The official copyright string of the current Python version is provided by Python.LibraryCopyright. If you want the identifier of the current platform, then use Python.LibraryPlatform.
We also have two functions that deal with the time in your programs. With Python.Time you can read out the so-called "wall clock" time. In contrast, Python.MonotonicTime determines the time on the monotonic clock. As the monotonic clock runs independently of the operating system time, it is particularly suitable for determining the duration of processes as it doesn't switch for and backwards for daylight time zone adjustments.