MonkeybreadSoftware Posted Friday at 06:17 AM Posted Friday at 06:17 AM 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 (https://www.libxl.com/table.html). 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: 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. iCloud We also have a new function Folders.UbiquityContainer on Mac and iOS that gives us the path to an iCloud container. You use this method to determine the location of your app's ubiquity container directories and to configure your app's initial iCloud access. The first time you call this method for a given ubiquity container, the system extends your app's sandbox to include that container. In iOS, you must call this method at least once before trying to search for cloud-based files in the ubiquity container. If your app accesses multiple ubiquity containers, call this method once for each container. You can use the path returned by this method to build paths to files and directories within your app's ubiquity container. Each app that syncs documents to the cloud must have at least one associated ubiquity container in which to put those files. This container can be unique to the app or shared by multiple apps. Goodies We also have a new goodie for you this time for the script workspace under MacOS. You can use the ScriptWorkspace.SetFocusToScriptList function to set the focus to the script list in the Script Workspace. This may help to make sure copy & paste commands to the script list target the scripts. You can also use the ScriptWorkspace.IsFocusOnScriptList function to check whether the focus is really on the script list. Audit Audit allows you to record and monitor changes in your database. We have also added new functions for this area in this release. With the function Audit.SetAuditLogTableName you can now set the name of the AuditLog table. You can also use the Audit.GetAuditLogTableName function to query this again at any time. You can use the Audit.SetUUIDFields and Audit.GetUUIDFields functions to change and retrieve the names of the UUID fields. We hope you will also find some interesting new features. We wish you a lot of fun with MBS FileMaker PluginVersion 15.2. If you need a license or have any questions, please contact us.
Recommended Posts