23 hours ago23 hr In this article we want to introduce you the new functions from the MBS FileMaker Plugin in version 16.4.MongoDBIn this edition, we'd like to introduce you to the new features related to bulk operations on a MongoDB database. Bulk operations allow you to modify multiple data records simultaneously. This results in significant time savings and improved performance, especially when working with large amounts of data. First, you can use MongoDB.BulkOperation.Create to create a bulk operation. You can then plan operations on your database using methods such as MongDB.BulkOperation.UpdateOne, MongoDB.BulkOperation.RemoveMany, and MongoDB.BulkOperation.Insert. MongoDB.BulkOperation.Execute is then used to execute the block of operations on the database. If you like, you can combine this with a transaction to perform a rollback in case of an error. You can find these and several other new, helpful features related to bulk operations in the documentation.DynaPDFWe have some new features in the DynaPDF area. With the DynaPDF.HaveOpenPath function, we can check whether there is an open path in memory that has not yet been closed by a DynaPDF.ClosePath or DynaPDF.ClipPath function. To discard the path, you can call the new DynaPDF.AbortPath function.There are new functions available that allow you to access the internal error log. DynaPDF uses the error log to store non-fatal errors or warnings when it is not required to break processing or if more detailed error information should be provided than is possible with the normal exception handling.For example, when opening a damaged PDF file with DynaPDF.OpenPDFFromFile the function tries first to open the file in normal mode. All errors which occur in this step are written to the error log. Depending on the kind of found errors, the function maybe falls back into repair mode and reads the file again. If this action is successful then the function returns with success and no error message is provided over the normal exception handling. So, you'll not notice that the file contained damages unless you take a look into the error log. The error log was introduced with DynaPDF 3.0. It is used when reading a PDF file, e.g. DynaPDF.OpenPDFFromFile, DynaPDF.ImportPDFPage, DynaPDF.ImportPDFFile, and when parsing or rendering PDF pages, e.g. DynaPDF.ParseContent, DynaPDF.IsEmptyPage, DynaPDF.IsColorPage, DynaPDF.ExtractPageText, DynaPDF.RenderPage, DynaPDF.RenderPDFFile, and so on. To determine the number of entries in the ErrorLog, use the DynaPDF.ErrLogMessageCount function. If you want to retrieve a single error, you can do so by specifying the index of the corresponding error using the DynaPDF.ErrLogMessage function.{ "Message": "syntax error at line 1", "ObjNum": -1, "Offset": 1, "SrcFile": "../svg/svg_loader.cpp", "SrcLine": 421, "ErrCode": -1, "ErrType": -1 } If you want to read all of them at once, use theDynaPDF.ErrLogMessagesfunction. As with the single-error version, you'll receive a JSON response listing all errors along with their corresponding information.We've also introduced new features related to vector graphics. For example, you can insert your company logo if it's available as an SVG. Using the DynaPDF.LoadSVG and DynaPDF.LoadSVGFile functions, you can load an existing SVG either from a container or from a file on your hard drive. Using the DynaPDF.InsertSVG function, you can then place and scale the graphic in your PDF. The function uses a native SVG-to-PDF converter that translates SVG graphics directly into PDF drawing operations and resources. Vector graphics remain vector-based whenever possible, preserving their scalability and rendering quality.# Start new PDF document Set Variable [ $pdf ; Value: MBS("DynaPDF.New") ] Set Variable [ $r ; Value: MBS("DynaPDF.AppendPage"; $pdf) ] # # Load SVG Set Variable [ $r ; Value: MBS("DynaPDF.LoadSVG"; $pdf; SVG::SVG) ] # # Place the image Set Variable [ $width ; Value: 500 ] Set Variable [ $Height ; Value: 0 // automatic ] Set Variable [ $r ; Value: MBS("DynaPDF.InsertSVG"; $pdf; 0; 0; $width; $height) ] # # close page and save Set Variable [ $r ; Value: MBS("DynaPDF.EndPage"; $pdf) ] Set Field [ MyTable::ContainerField; MBS( "DynaPDF.Save"; $pdf; "report.pdf" ) ] Set Variable [ $r ; Value: MBS("DynaPDF.Release"; $pdf) ] In addition to inserting SVG files, you can also retrieve additional information about a loaded SVG-such as its size-usingDynaPDF.GetSVGSizeandDynaPDF.GetSVGSizes. An SVG file can consist of multiple embedded SVG graphics. You can determine the number of these usingDynaPDF.GetSVGSymbolCount. The functionsDynaPDF.GetSVGSymbolNameandDynaPDF.GetSVGSymbolNamesreturn the names of the SVG symbols.EncryptionIn the Encryption section, we have two new functions designed to help you with AES encryption using GCM mode. The Encryption.SetGCMTag function sets the GCM authentication tag for the next decryption. The Encryption.GetGCMTag function retrieves the GCM authentication tag from the last encryption.Relationships in JSONLet's move on to a tool designed to help you gain an overview of the database structure, for example, when working with external solutions. We're talking about the FM.Relations function. This function displays the relationships in the database as JSON. The relationships for each individual table are specified in this JSON. Take a look, for example, at this JSON, which was generated from the relationship diagram shown in the image:[ { "TableName": "Customer", "TableID": 1065090, "BaseTableName": "Customer", "BaseFileName": "16.4", "ModCount": 1, "Relations": [ { "Source": "16.4", "Table": "Orders", "Options": "", "Conditions": [ "Orders::Customer_ID = Customer::P_Customer_ID" ] }, { "Source": "16.4", "Table": "Mails", "Options": "", "Conditions": [ "Mails::Customer_ID = Customer::P_Customer_ID" ] }, { "Source": "16.4", "Table": "Shipping_Addresses", "Options": "", "Conditions": [ "Shipping_Addresses::Customer_ID = Customer::P_Customer_ID" ] } ] }, { "TableName": "Items", "TableID": 1065092, "BaseTableName": "Items", "BaseFileName": "16.4", "ModCount": 2, "Relations": [ { "Source": "16.4", "Table": "Orders", "Options": "", "Conditions": [ "Orders::P_Orders_ID = Items::Orders_ID" ] } ] }, { "TableName": "Mails", "TableID": 1065093, "BaseTableName": "Mails", "BaseFileName": "16.4", "ModCount": 2, "Relations": [ { "Source": "16.4", "Table": "Customer", "Options": "", "Conditions": [ "Customer::P_Customer_ID = Mails::Customer_ID" ] } ] }, { "TableName": "Orders", "TableID": 1065091, "BaseTableName": "Orders", "BaseFileName": "16.4", "ModCount": 2, "Relations": [ { "Source": "16.4", "Table": "Customer", "Options": "", "Conditions": [ "Customer::P_Customer_ID = Orders::Customer_ID" ] }, { "Source": "16.4", "Table": "Items", "Options": "", "Conditions": [ "Items::Orders_ID = Orders::P_Orders_ID" ] } ] }, { "TableName": "Shipping_Addresses", "TableID": 1065094, "BaseTableName": "Shipping_Addresses", "BaseFileName": "16.4", "ModCount": 2, "Relations": [ { "Source": "16.4", "Table": "Customer", "Options": "", "Conditions": [ "Customer::P_Customer_ID = Shipping_Addresses::Customer_ID" ] } ] }, { "TableName": "Table", "TableID": 1065089, "BaseTableName": "Table", "BaseFileName": "16.4", "ModCount": 1, "Relations": [] } ] In comparison to the relational diagram, the JSON sometimes makes it even easier to understand the relationships, since-in addition to the table names-we also learn the BaseTable name and exactly how the relationships between the tables are defined. We hope this tool will be helpful to you in your analyses.WindowYou may be familiar with this situation: You're working in FileMaker when a dialog box pops up, and instead of clicking OK, you have to click a different button, such as Cancel. And this dialog box appears not just once, but multiple times. Each time, you have to move your hands from the keyboard to the mouse to press the correct button in the dialog box. But you can now solve this problem with the MBS FileMaker Plugin, because the Window.EnableEscForCustomDialog function lets you use the Escape key to confirm a button of your choice in the dialog box. In the function, you specify the name of the desired button in the parameters. If the parameter is set to an empty string, this function is disabled again. Now, if you press the Esc key while the dialog is open, the corresponding button in your dialog will be clicked.SignaturesWhen installing the MBS FileMaker Plugin, you may want to know before installation whether the file has been modified. You can perform this check using Files.CheckSignature. This function validates the signature of an application, library, or plugin. If you want more information about a code-signed file, use the Files.SignatureInfo function. It returns a JSON object containing the available information.MBS( "Files.SignatureInfo"; "/Users/cs/Desktop/MBS.fmplugin" ) Example result: { "source" : "embedded", "teamIdentifier" : "RZ52899P4B", "format" : "bundle with Mach-O universal (x86_64 arm64)", "mainExecutable" : "\/Users\/cs\/Dokumente\/FileMaker Output\/MBS.fmplugin\/Contents\/MacOS\/MBS", "unique" : "mws\/4QAWUpL6HIfwKDQQaunjLnE=", "CertificateChain" : [ { "Issuer" : "C=US,O=Apple Inc.,OU=Apple Certification Authority,CN=Developer ID Certification Authority", "Index" : 0, "SerialNumber" : "2D:9C:3E:B8:13:65:65:86", "ValidUntil" : "2027-02-01 22:12:15 +0000", "Name" : "Developer ID Application: Christian Schmitz Software GmbH (RZ52899P4B)", "ValidFrom" : "2022-04-07 09:25:24 +0000", "Subject" : "C=US,O=Christian Schmitz Software GmbH,OU=RZ52899P4B,CN=Developer ID Application: Christian Schmitz Software GmbH (RZ52899P4B),UID=RZ52899P4B" }, { "Issuer" : "CN=Apple Root CA,OU=Apple Certification Authority,O=Apple Inc.,C=US", "Index" : 1, "SerialNumber" : "18:7A:A9:A8:C2:96:21:0C", "ValidUntil" : "2027-02-01 22:12:15 +0000", "Name" : "Developer ID Certification Authority", "ValidFrom" : "2012-02-01 22:12:15 +0000", "Subject" : "C=US,O=Apple Inc.,OU=Apple Certification Authority,CN=Developer ID Certification Authority" }, { "Issuer" : "CN=Apple Root CA,OU=Apple Certification Authority,O=Apple Inc.,C=US", "Index" : 2, "SerialNumber" : "02", "ValidUntil" : "2035-02-09 21:40:36 +0000", "Name" : "Apple Root CA", "ValidFrom" : "2006-04-25 21:40:36 +0000", "Subject" : "CN=Apple Root CA,OU=Apple Certification Authority,O=Apple Inc.,C=US" } ], "identifier" : "de.monkeybreadsoftware.fmplugin.MBS", "HashAlgorithm" : "SHA-256", "flags" : 0, "timestamp" : "2026-08-17 10:27:16 +0000" } Querying Version NumbersIn the Plugin section, we've included three small functions that may be useful to you depending on the context, such as when debugging. Plugin.LibXMLVersion queries the version of the XML library. Plugin.LibXSLTVersion returns the version number of the current XSLT library. The Plugin.LicenseExpiration function returns the expiration date of the plugin license.In the Llama section, we've also added a new Llama.Version function that queries the version of the loaded llama-cpp library.XLWe've also added a new function in the LibXL section. The XL.ClearLicense function removes the license key without unloading the library. It's very similar to the long-standing XL.Uninitializefunction, with the difference that this function simply forgets the license key and the library does not need to be reloaded.MacThere are also new features for MacScriptWorkspaceThere are new features in the ScriptWorkspace section. The ScriptWorkspace.CurrentTabIsPreview function allows you to check whether the current tab has a preview button. If you also want to trigger this button via script, the ScriptWorkspace.CurrentTabTogglePreview function can help you do so. You can now also close the current tab programmatically by using ScriptWorkspace.CurrentTabToggleClose to toggle the close button on the current tab.In addition, you can now programmatically set the focus to the script using ScriptWorkspace.SetFocusToScript.Syntax ColoringThe next feature I'd like to introduce to you was explicitly requested by some of you. With the SyntaxColoring.AddCustomFunctionTooltip function, you can add a tooltip to a custom function. The idea is to have the start script in your solution add tooltips for the custom functions you use in the solution. The tooltips are not saved, so they need to be set whenever FileMaker Pro is launched.Here's how you can set a tooltip for the MBS function:MBS("SyntaxColoring.AddCustomFunctionTooltip"; "MBS"; "Best function ever!")You can use the SyntaxColoring.SetFieldTooltipsEnabled and SyntaxColoring.GetFieldTooltipsEnabled functions to set and check whether tooltips for fields are enabled in the database design dialog.This area we're currently discussing has become particularly well-known due to script syntax highlighting. If you want to know which elements are highlighted in which colors during script syntax highlighting, you can now use the SyntaxColoring.GetTagsJSON function to retrieve a JSON list of the colors associated with the corresponding elements.We hope you will also find some interesting new features. We wish you a lot of fun with MBS FileMaker Plugin Version 16.4. If you need a license or have any questions, please contact us.This text was translated using Ki Tools.
Create an account or sign in to comment