In this article we want to introduce you the new functions from the MBS FileMaker Plugin in version 13.4.
Let's start with the most comprehensive and coolest new feature of the release: Phidgets. Phidgets are small additional devices that you can connect to your computer and with which you can then input or output data. For example you can connect a small motor, a temperature sensor, a humidity sensor, a gyroscope or a small LED display and exchange data with these devices. Since a few years we already have a plugin for Xojo, which allows the interaction with these small devices and we are proud to offer the use of these small devices now also for FileMaker.
With Phidget.Load we first load the Phidget library we want to work with. With Phidget.Create we create an instance of a Phidget channel. Once created the channel may need to be configured to match the physical device and channel index you want to attach to, and then be opened by calling Phidget.Open. The Phidget channel handle must be released with Phidget.Release. With the functions Phidget.SetProperty and Phidget.GetProperty you can set and get properties of a specific Phidget. A function that is even more powerful is the Phidget.SetScriptTrigger function, which allows you to set a script to be started when a certain event occurs. This can be e.g. with a temperature sensor a detected change in the temperature. These and many more functions are waiting for you in the new component Phidget. We are excited what new projects you can implement with these little helpers.
Once again, there is news about the MongoDB component in this release. We have updated our SSL support for our MongoDB functions. In the process, we are switching to OpenSSL as the transport encryption library for the MongoDB library for macOS and iOS. The MongoDB.SSLLibrary function tells you which SSL library is being used. You can use the MongoDB.SetSSLOptionsfunction to specify SSL options in addition to entering them in the connection string. To check possible reasons for connection problems, there is a new trace logging function with the MongoDB.IsTracing and MongoDB.Trace functions. And by calling the MongoDB.Ping function regularly, you can check if the connection still exists and is kept open. We have also added a parameter to the already existing MongoDB.Connect function where you can specify whether a ping should be sent to the server on a regular basis.
In the last release we already touched the topic DPartNode. Since the last release you can add the Document Part metadata in the PDF document. Now we give you with the new function DynaPDF.DeleteDPartNode the possibility to delete a DPartNode and the structure which is attached to it.
For the component TOTP which deals with time-based one-time passwords we have two new functions for encoding and encoding base 32 strings.
Set Variable [ $Text ; Value: MBS( "TOTP.DecodeFromBase32"; "JBSWY3DPEBLW64TMMQ======" ) ]
When we work with URLs, we usually need the absolute URL. The new CURL.ProcessRelativeURL function now offers us the possibility to convert a relative URL into an absolute URL by additionally specifying the base URL.
With the new XML.InsertRecords function you can now import records that are in an XML document into your FileMaker database. To do this, first specify the XML in the parameters of the function, then a flag to indicate whether parsing should continue even if an error occurred in the XML, then the name of the file and the table name in which the records are written. So in this example, import two records into the Test table of the calling file. The values are entered in the fields of the same name in the table.
Set Variable [ $r ; Value: MBS( "XML.InsertRecords"; " John Mill 45 Harry Potter 36 "; 1; Get(FileName); "Test" )]
There are also two new functions for the Serial Port section. The SerialPort.OpenPath function Opens a special file, device or pipe. That you define in the parameters. This allows you to e.g. open a pipe on Windows. As result you get a reference number that you can use in other SerialPort functions.
The second new function is Windows only. he SerialPort.WaitNamedPipe function waits for a named pipe until either a time-out interval elapses or an instance of the specified named pipe is available for connection. If a pipe is available, the function returns OK, else an error.
There are also new features for Mac and the iOS SDK
The new features in the files section are all about cloud files. With the function Files.StartDownloadingUbiquitousItem you can start the download of a cloud file by specifying the path to the file in the parameters. If a cloud-based file or directory has not been downloaded yet, calling this method starts the download process. If the item exists locally, calling this method synchronizes the local copy with the version in the cloud.
The new Files.EvictUbiquitousItem method deletes your local copy of the cloud file. With the Files.UbiquitousItemStatus method we get more information about a cloud file. As a return we get a JSON for the file specified in the parameters, which contains the following keys:
|IsUbiquitousItem||True if this item is synced to the cloud, false if it is only a local file.|
|IsExcludedFromSync||True if the item is excluded from sync, which means it is locally on disk but won't be available on the server. An excluded item is no longer ubiquitous.|
|IsDownloading||True if data is being downloaded for this item.|
|IsUploading||True if data is being uploaded for this item.|
|IsUploaded||True if there is data present in the cloud for this item.|
|IsDownloaded||True if file is downloaded.|
|DownloadingError||The error when downloading the item from iCloud failed.|
|DownloadingStatus||The download status of this item. Can be NotDownloaded, Downloaded, Current or undefined.|
|DownloadRequested||Whether a download of this item has already been requested.|
|UploadingError||The error when uploading the item to iCloud failed.|
|HasUnresolvedConflicts||True if this item has conflicts outstanding.|
For example, a result returned by the function may look like this:
In this release we have 4 new functions for working with the Photopicker. This is able to show us the photos in the photo library in a panel from which we can then select them. With the new functions PhotoPicker.SetDisabledCapabilities and PhotoPicker.GetDisabledCapabilities we Set and get which Capabilities of the picker that should be disabled. In doing so, we can set or get a combination of the following values:
|None||0||No specified capabilities|
|Search||1||The search bar|
|StagingArea||2||The staging area|
|CollectionNavigation||4||The sidebar or the albums tab|
|SelectionActions||8||The "Cancel" and the "Add" (if possible) button|
|SensitivityAnalysisIntervention||16||Show intervention UI explaining potential risks for kids or teens if a sensitive asset is selected. Analysis and intervention will only be performed if "Communications Safety" is enabled in ScreenTime|