Xojo Conferences
MBSOct2019CologneDE
XDCMarch2020NashvilleUS

« Zwei Monate bis zur F… | Home | Vision Framework for … »

Whats new in MBS FileMaker Plugin version 9.3


Since July 2019 we offers a new version of our FileMaker Plugin. Let me show you the new function and how you can use it.

New functions for better working with the MBS FileMaker Plugin
Maybe you have asked yourself how often you use the MBS FileMaker Plugin. Now you can answer this question by using the "Plugin.CallCounter" function. This function shows you how many times you called a MBS FileMaker Plugin function. The call of this function also counts.
For a better debugging of the MBS FileMaker Plugin we developed the “Plugin.InstallSignalHandlers” function. With this function you install the signal handler invoked by the OS when the application crashes. Thats helps to detect what and where exactly is the problem. Usually you call this function only if we ask you to help on debugging a crash on Linux or MacOS. Our plugin then prints a backtrace to show where the crash happened.

New possibilities in debugging
New for the debugging is the Trace.SetErrorsOnly function. If you call this and use our Trace functions you log only the MBS FileMaker Plugin calls that return errors. Whether this option is set can be queried with the Trace.GetErrorsOnly function. With Trace.SetWithTimes the time is additionally logged. Trace.GetWithTimes evaluates whether this option is set.

A helping tool for command line tools debugging is the new Shell.GetArguments function. This function query a list of all arguments of the shell. Use it to look whether an argument that you need is missing.

Test your XML import
For better XML import debugging we offers you the XML.Import.Errors function, which list all errors. It only reports each error once. With XML.Import.ErrorCount you can count the errors. Because of this you can learn, whether you had errors during the import.

News from JSON
Similar functions for import exist for JSON. JSON.Import.Errors and JSON.Import.ErrorCount help you detect the problems during imports.
One new more function for JSON is the JSON.Sort function. This function sort the elements of an array or object. e.g. you input "[9, 6, 108, 4, 78, 45, 24, 9388, 788, 167]” and get
“[4, 6, 9, 24, 45, 78, 108, 167, 788, 9388]” as result.

Clear out old connections
The CURL functions cache and reuse existing connections to skip connecting and login for multiple similar queries. The CURL.SetOptionMaxAgeConn function determines the maximum age for connections. If they are older, they are not used anymore and are removed. You set the maximum age of a connection in seconds.

Compare your tables
Perhaps you have different tables that you want compare with each other, test whether and where records are changed, whether fields are added or deleted. The MBS FileMaker Plugin offers you a new function for this to make comparing easier and faster for your application. If you have two tables you can use the FM.CompareTables function. In the parameters you set the application name, the table name and ID fields for both tables . If you call this function it returns a JSON object, which includes the informations about the changes. The JSON object e.g. look like this:

{
  "Messages":   [],
  "TableName1":   "Import2PropertyVal",
  "TableName2":   "Import2PropertyVal",
  "FileName1":   "test1.fmp12",
  "FileName2":   "test2.fmp12",
  "RemovedFields":   [],
  "Fields":   ["Hex", "Hex.bytes", "PropertyVal.Name", "_CreationTimeStamp", "_ParentRecordUUID", "_RecordUUID", "test"],
  "AddedFields":   [],
  "RemovedIDs":   [],
  "AddedIDs":   [],
  "ChangedRecords":   {
    "B92DB7FE-2506-4070-A384-BE99AE829EB8":   [{
        "Field":   "Hex.bytes",
        "OldValue":   "",
        "NewValue":   "3"
      }, {
        "Field":   "test",
        "OldValue":   "Hello",
        "NewValue":   "World"
      }],
    "8D9BD00C-C31B-401B-B18C-0BCB0CC9EC73":   [{
        "Field":   "Hex.bytes",
        "OldValue":   "1",
        "NewValue":   "2"
      }],
    "2FED79CC-1BBF-4C5D-96E4-5E42C8454C3A":   [{
        "Field":   "Hex.bytes",
        "OldValue":   "1",
        "NewValue":   "2"
      }]
  }
}

We compare the field names for both tables and report added, removed and common field names. Then we check the record identifiers to report added, changed and common IDs. Optionally we compare the common records to report the changed record identifiers. Records are compared in 100 records block to limit memory usage.

New liberty for Images in containers
With the new function GMImage.WriteToContainer you can write your image to a container in any format offered by GraphicsMagick library. This is similar to other container writing functions in the GraphicsMagick Component, but it is special that you can use any codec that you want for writing the image to the Container, with this function. If it is a known format to FileMaker, you get a preview in the container field.
 
Get the version of the Zint library
Also new is the Barcode.LibVersion function. With this function you query the version of the Zint library. This library you use for the creating barcodes with the MBS barcode functions. As we updated the library, we got a few more barcode types (over 80 supported!).

Get Informations about your texts
In this Plugin version we add two new text functions. With Text.Styles you query the text style informations in JSON format. The Result of the function can e.g. look like this:
[{
    "hasColor":   true,
    "color":   16711680,
    "colorHex":   "FF0000",
    "red":   255,
    "green":   0,
    "blue":   0,
    "alpha":   255,
    "hasFont":   false,
    "hasSize":   false,
    "hasFace":   false
  }]

It returns a JSON array with several values. If the text has a color you get the color as a numeric value, in hexadecimal, and the single RGB values with the alpha canal.
If the text has a font you get the FontID, fontScript and font name.
If hasSize would be true, then the array contains the size of the font points. If hasFace would be true, you get the text styles as integer. We provide bold, italic, outline, shadow, condense, extend, strikethrough, smallCaps, superscript, subscript, wordUnderline and doubleUnderline.

The second new text function is Text.FilterUTF16. This function finds all UTF 32 characters, which can't be represented in UTF-16 and replace them with a given text. This allows you to replace similes and other high level unicode characters with other text. Useful if you talk to an API, which doesn't handle UTF-32 characters perfectly.

dialog box with filter result

Get information about the preferences
The new function Preferences.GetValueType returns you the type of a preference setting. The result is: Text, Data, Integer, Double, Boolean, Array or Dictionary. This information allows you to pass right type for Preferences.SetValue to change a setting of FileMaker itself or another application on MacOS.

Get new informations about your active directory
We add the SystemInfo.ADSystemInfo function for Windows to learn details about the current user's Active Directory entry. With the call of this function you get UserName, ComputerName, SiteName, DomainShortName, DomainDNSName, ForestDNSName, PDCRoleOwner, SchemaRoleOwner, IsNativeMode, DCNam and DCSiteName as a JSON result from your active directory. A result e.g. can looks like this:

{
"UserName": "CN=John Doe,OU=2SH User,DC=2SXXX,DC=2S",
"ComputerName": "CN=2SMBP16W10,CN=Computers,DC=2SXXX,DC=2S",
"SiteName": "Default-First-Site-Name",
"DomainShortName": "2SXXX",
"DomainDNSName": "2SXXX.2S",
"ForestDNSName": "2SXXX.2S",
"PDCRoleOwner": "CN=NTDS Settings,CN=2SDCERP,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=2SXXX,DC=2S",
"SchemaRoleOwner": "CN=NTDS Settings,CN=2SDCERP,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=2SXXX,DC=2S",
"IsNativeMode": true,
"DCName": "2SDCSTORAGE.2SXXX.2S",
"DCSiteName": "Default-First-Site-Name"
}

If the function return an empty JSON object, no active directory is in use.

For macOS we can check if the operating system is MacOS 10.15 Catalina or newer. For this you can use the new function SystemInfo.isCatalina. It will return 1 if it is true. It returns 0 if it is an older MacOS version or an other operating system.

New functions for iOS and Mac
We have also new functions for iOS and MacOS:

New Event reminder functions
We add two new functions for reminders. Now you can query the due date and the start date as timestamps. This makes it easier to handle them in FileMaker. The query only returns a result, if a real date is entered and not a few date components like “second Tuesday".

Notifications for iOS
Additional we have new notification functions. With UNNotification.Deliver you deliver a notification immediately. If you want to deliver a notification based on date and time value, you can set a trigger for this notification with the UNNotification.SetCalendarDateTrigger function.
UNNotification.GetDescription shows technical details from the framework about the specified notification.

More for WebView
We got new functionality for WebView: With WebView.StopLoading function you can stop the loading of all resources of the current page. In combination with the WebView.HasOnlySecureContent function, which query whether all resources on the page have been loaded over securely encrypted connections. The WebView.HasOnlySecureContent function works for windows too, but only query whether the url is a https connection. In addition Webview.GetAllowsLinkPreview and Webview.SetAllowsLinkPreview are get and set functions for the option whether link previews show is allowed in the webView. The default value is true.

MapView
We also extended the functionality of out MapView for Mac & IOS which is based on Apple Maps.
Now you can set a script trigger for pins with MapView.SetScript. The function call a specified script, if any pin is clicked. Additional we can render screenshots of MapViews by using the MapView.Screenshot function. The rendering includes annotations and overlays as they are visible. Like here a map showing my daily commute:
map view with route

From Stefanie Juchmes
17 08 19 - 10:50