4 hours ago4 hr In this article we want to introduce you the new functions from the MBS FileMaker Plugin in version 16.2.DynaPDFThis release includes new features for DynaPDF. With DynaPDF.Parser.Content, you can now retrieve the page content as JSON. In the parameters, you can limit the information in the JSON by specifying a filter. For example, the code snippet below retrieves only the DrawPath operators.Set Field [ DynaPDF Replace Text::Content ; MBS( "DynaPDF.Parser.Content"; $pdf; "DrawPath") ] [ { "OperatorIndex": 5, "OperatorCode": 8, "Operator": "DrawPath", "IsOpener": false, "IsCloser": false, "IsGSProperty": false, "IsDrawingCommand": true, "BBox": { "x1": 0, "y1": 0, "x2": 0, "y2": 0 }, "Mode": 0, "OP": [5, 4, 4, 4, 3], "OPNames": ["MoveTo", "LineTo", "LineTo", "LineTo", "ClosePath"], "OPCount": 5, "Vertices": [ { "x": 0, "y": 595.275574 }, { "x": 842, "y": 595.275574 }, { "x": 842, "y": -0.724426 }, { "x": 0, "y": -0.724426 } ], "VerticesCount": 4 }, { "OperatorIndex": 23, "OperatorCode": 8, "Operator": "DrawPath", "IsOpener": false, "IsCloser": false, "IsGSProperty": false, "IsDrawingCommand": true, "BBox": { "x1": 0, "y1": 0, "x2": 0, "y2": 0 }, "Mode": 1, "OP": [ 6 ], "OPNames": [ "Rectangle" ], "OPCount": 1, "Vertices": [ { "x": 0, "y": 0 }, { "x": 645, "y": 400 } ], "VerticesCount": 2 }, { "OperatorIndex": 285, "OperatorCode": 8, "Operator": "DrawPath", "IsOpener": false, "IsCloser": false, "IsGSProperty": false, "IsDrawingCommand": true, "BBox": { "x1": 0, "y1": 0, "x2": 0, "y2": 0 }, "Mode": 1, "OP": [5, 4], "OPNames": [ "MoveTo", "LineTo" ], "OPCount": 2, "Vertices": [ { "x": 0, "y": 0.5 }, { "x": 165, "y": 0.5 } ], "VerticesCount": 2 }, { "OperatorIndex": 321, "OperatorCode": 8, "Operator": "DrawPath", "IsOpener": false, "IsCloser": false, "IsGSProperty": false, "IsDrawingCommand": true, "BBox": { "x1": 0, "y1": 0, "x2": 0, "y2": 0 }, "Mode": 1, "OP": [5, 4], "OPNames": [ "MoveTo", "LineTo" ], "OPCount": 2, "Vertices": [ { "x": 0, "y": 0.5 }, { "x": 165, "y": 0.5 } ], "VerticesCount": 2 } ] With the DynaPDF.Parser.Delete function, you can now also delete operators on the current page. In the parameters, you can specify the index of the corresponding operator. As mentioned above, the DynaPDF.Parser.Content function is available to help you find this index.If you'd like to learn more about PDF structures and content streams, we recommend our new blog article Understanding PDF Structure and Content StreamsIn DynaPDF, you can also embed tables. In this release, the DynaPDF.Table.SetColOrRowSpan function allows you to specify the row height or column width of a cell in your table. In the parameters of this function, you first specify the table in which the cell is located. Then you define the cell using its row and column numbers. Next, you specify the height or width of the cell. In the last parameter, you specify whether to use col span (true) or row span (false).CURLSince years, our plugin has included the CURL.SetOptionHTTPHeader function. While CURL.SetOptionHTTPHeader sets all HTTP headers, you can call the new CURL.AddOptionHTTPHeader function as often as needed to add additional HTTP headers. This function accepts a variable number of parameters. Pass as many parameters as needed, separated by semicolons in FileMaker.Set Variable [ $curl ; Value: MBS("CURL.New") ] Set Variable [ $result ; Value: MBS("CURL.SetOptionURL"; $curl; CURL Test::URL) ] Set Variable [ $result ; Value: MBS( "CURL.AddOptionHTTPHeader"; $curl; "Content-Type: application/json" ) ] Set Variable [ $result ; Value: MBS( "CURL.AddOptionHTTPHeader"; $curl; "Expect:"; "Cache-Control: no-cache" ) ] Set Field [ CURL Test::Result ; MBS("CURL.Perform"; $curl) ] SQLYou also get a new function from the FM module for debugging SQL. With FM.ExecuteSQL.LastParameters, you can retrieve the query parameters from the last failed SQL command. This allows you to debug issues with MBS functions that execute multiple commands; for example, you can see which values were used in the failed insert record. For more information on this and other SQL debugging features, check out our new article SQL error checking improved on our blog.FileStateWith the new Files.Stat function, you can check the file status of a file or directory. The result is a JSON object containing the relevant information. It might look like this, for example:Graphics MagickWith the new GMImage.AffineTransform function, we have added a feature that applies a specified affine or free transform matrix to an image.JSON and TOONIn the last release, we introduced the JSON.ToToon function, which converts JSON to TOON. TOON is an information format particularly well-suited for use with AI communication. It minimizes the number of tokens required for communication. Now, with the new version 16.2, we've also added a function that converts TOON to JSON. We hope the JSON. FromToon will make your work with AI even easier.LlamaWe also introduced the new Llama section in the last version. A new addition is the Llama.LoadBackend function. It loads a backend for Llama from a location specified by a path. By default, we load all backends. But if you have a separate library located elsewhere, you can explicitly load it using Llama.LoadBackend.MatrixWe have also added new features to the Matrix section. One feature that can be helpful in many areas is the Matrix.MBS function. It allows you to run a function with a variable parameter list. The values for the desired parameters are entered into a matrix, which is then processed by our Matrix.MBS function to collect the values. This might look as follows:let([ m = MBS("Matrix.New"; 3; 1); s = MBS("Matrix.SetValue"; m; 0; 0; "Hello"); s = MBS("Matrix.SetValue"; m; 1; 0; " "); s = MBS("Matrix.SetValue"; m; 2; 0; "World"); r = MBS("Matrix.MBS"; m; "Text.Concat"); m = MBS("Matrix.Release"; m) ]; r) If you'd like to learn more about this feature, feel free to check out our article Introducing Matrix.MBS: Dynamic Function Calls with Matrix ParametersThree functions that can be particularly useful in connection with this feature also been added: You can use the Matrix.SearchAndReplacefunction to search for text in a matrix and then replace it with different text. With the Matrix.SwapColumns and Matrix.SwapRows functions, you can swap columns or rows within a matrix.Web ViewThe new WebView.CreateWindow function is a powerful tool. With this function, you can create a standalone WebViewer window that is hidden by default and can be used to perform tasks in the background, for example. The window can be displayed as needed and can be controlled using both WebViewer functions and standard window functions. If you'd like to learn more about this great feature and what you can do with it, feel free to check out our blog post Creating Custom Web Viewer Windows in FileMaker with MBS FileMaker PluginFor Windows users, we've introduced a new feature called WebView.MoveFocus, which allows us to control the focus on our WebViewer and its elements. WebView changes focus through user interaction including selecting into a WebView or Tab into it. For tabbing, the app runs MoveFocus with Next or Previous to align with Tab and Shift+Tab respectively when it decides the WebView is the next tabable element.FoundationModelsLast but not least, we also have news for Mac users. The FoundationModels section has also gained two new functions. First, you can determine the maximum size of the context supported by a model. The FoundationModels.ContextSize function returns the allowed number of tokens that can be used in a single session, including both input prompts and generated responses. If you want to determine how many tokens a specific request has, you can use FoundationModels.TokenCount. In the parameters of this function, you first specify the LLM to which you want to send the request and, in another parameter, the instructions text. You will then receive a number that describes the token count for the specified instructions.We hope you will also find some interesting new features. We wish you a lot of fun with MBS FileMaker Plugin version 16.2. If you have any Ideas for new cool features, need a license or have any questions, please contact us.
Create an account or sign in to comment