Jump to content

Recommended Posts

Posted

In this article we want to introduce you the new functions from the MBS FileMaker Plugin in version 15.3.

SQL

First of all, I would like to introduce you to the new features for SQL. A very interesting function is the SQL.InternalSQLiteLibrary.Dump function. This function convert an SQLite database into UTF-8 text SQL statements that will exactly recreate that original database.

We also have new functions that allow you to activate extensions within SQLite. With SQL.InternalSQLiteLibrary.SetBase64ExtensionEnabled you can enable the base64 extensions to convert (binary) blobs and base64 text into each other. You can also use SQL.InternalSQLiteLibrary.SetCSVExtensionEnabled to activate the CSV extensions and thus have an implementation of an SQLite virtual table for reading CSV files. You also have the function SQL.InternalSQLiteLibrary.SetUUIDExtensionEnabled which activates a uuid extension. This SQLite extension implements functions that handling RFC-4122 UUIDs.

CURL

There is also a new function in the CURL area. With the function CURL.SetOptionSSLSignatureAlgorithms you set the TLS supported signature algorithms. Enter a colon-delimited list of signature scheme names in the parameters. You can also take a look at the CURL documentation. You can find this for the function here.

DynaPDF

A very popular feature in DynaPDF is the signing of documents. This allows the user to ensure that the document has not been changed in the meantime. A PDF document that is signed can sometimes have several signature fields. In this case, the first signature field without a value is selected for signing by default. With the new function DynaPDF.SetActiveSigField you can choose which field should be signed.

Files

If you are on a Mac or on Windows, you can print files with the new Files.PrintFile function without having to open the files manually. This function can save you time and automate processes. It opens the application associated with the file type and asks it to print the document. This requires cooperation from the applications and not all applications support this.

Java

We have also added three new functions for working with Java. You can use the Java.GetLoadedClasses function to output a JSON containing information about each class. This can look like this:

[
	{
		"name":	"jdk.internal.misc.CarrierThread",
		"methodCount":	0,
		"fieldCount":	0,
		"modifiers":	33,
		"IsPublic":	true,
		"IsFinal":	false,
		"IsSuper":	true,
		"IsInterface":	false,
		"IsAbstract":	false,
		"IsSynthetic":	false,
		"IsAnnotation":	false,
		"IsEnum":	false,
		"IsModule":	false,
		"signature":	"Ljdk/internal/misc/CarrierThread;",
		"status":	0,
		"IsVerified":	false,
		"IsPrepared":	false,
		"IsInitialized":	false,
		"IsError":	false,
		"IsArray":	false,
		"IsPrimitive":	false
	}, 
	...
]

The Java.GetClassMethods function returns a JSON for the individual methods of a specific class. We specify the name of the class for which we want to retrieve the information in the parameters of the function. Here you can see an example JSON that the function returns:

[
	{
		"index":	0,
		"name":	"<init>",
		"signature":	"(Ljava/lang/String;Ljava/lang/Throwable;ZZ)V",
		"modifiers":	4,
		"IsPublic":	false,
		"IsPrivate":	false,
		"IsProtected":	true,
		"IsStatic":	false,
		"IsFinal":	false,
		"IsSynchronized":	false,
		"IsBridge":	false,
		"IsVarArgs":	false,
		"IsNative":	false,
		"IsAbstract":	false,
		"IsStrict":	false,
		"IsSynthetic":	false,
		"argumentsSize":	5,
		"native":	false,
		"obsolete":	false
	}, 
	...
]

Math

We have a few new functions for you in the  Math section. First, we can now set and read the individual bits of a number that is internally converted into a binary value. For example, you can determine whether a number is even or odd without having to do a lot of arithmetic. Use the  Math.GetBit function and look at the first bit (value 0) if the first bit is a 1, then the number is odd. if it is a 0, then the number is even.

Set Variable [ $bit1 ; Value: MBS("Math.GetBit"; 12; 0) ]
Set Variable [ $bit2 ; Value: MBS("Math.GetBit"; 13; 0) ]
Show Custom Dialog [ "First Bit" ; "12 => " & $bit1 & "¶13 => " & $bit2 ]

MBS15.3_B1.png

Using the  Math.ClearBit function, we can clear a bit that we can specify in the parameters. This is then replaced with a 0. For example, if we look at the 5, then the binary code of the five is 101. If we now apply ClearBit to the 3rd bit (specified with the value 2), then we get a 1 as a return, because our representation of the binary number now looks like this: 001. So only the representation of the 1 remains.

Matrix

There is also an update in the Matrix area - we have expanded the possibilities for you. If you want to copy the content of a matrix to another matrix, you can use the new  Matrix.CopyContent function.

You can now append a matrix to another matrix. This can look like this, for example. The first matrix is a 3x4 matrix with numbers as values and the second matrix is a 1x4 matrix with characters as values.

Let([

// new matrix
      
matrix = MBS("Matrix.New"; 3; 4);
      
// add some content
      
r = MBS( "Matrix.SetRow"; matrix; 0; "00¶01¶02¶03" );
      
r = MBS( "Matrix.SetRow"; matrix; 1; "10¶11¶12¶13" );
      
r = MBS( "Matrix.SetRow"; matrix; 2; "20¶21¶22¶23" );
      

// creates a second matrix
      
matrix2 = MBS("Matrix.New"; 1; 4);
      
r = MBS( "Matrix.SetRow"; matrix2; 0; "a¶b¶c¶d" );

      
// copy content of first matrix to second
      
r = MBS( "Matrix.Append"; matrix; matrix2 );
      

// output matrix to check
      
csv = MBS("Matrix.CSV"; matrix)
]
; csv)

MBS15.3_B2.png

From now on, you can also insert individual rows and columns in a matrix. To do this, use the Matrix.InsertColumnand Matrix.InsertRow functions.

Plugin

Would you like to be able to use your own functions across multiple FileMaker databases?

Then the Plugin.RegisterFunction function may be your perfect match. With this function you can register a custom function for your solution, which is accessible to all files.

In the parameter of this function, you first pass a number greater than 3 as the unique ID. You pass a name for the function as well as the prototype, i.e. how the function should be called with its parameters. Now follows the expression to be executed. Optionally, you can also specify the minimum and maximum number of parameters. This gives you space for optional parameters. An example of such a function definition could look like this:

Set Variable [ $r ; Value: MBS("Plugin.RegisterFunction";
    123; // ID to use
    "Concat"
    "Concat(Value1; Value2)";
    "Value1 & Value2";
    2; // min and max parameters
    2) ]

We have added three additional functions to help you with your work. The Plugin.CustomFunctionNames function lists the names of the CustomFunctions. 

If your function takes a variable number of parameters, you can query the count With Plugin.CustomFunctionParameterCount and use Plugin.CustomFunctionParameter to return a specific parameter for the current function.

We can do something similar for script steps with the Plugin.RegisterScriptStep function. First, we specify the ID >3, the name and an XML that defines the script step. This is followed by the expression that is to be executed. Finally, there is a description to be displayed in the user interface.

MBS( "Plugin.RegisterScriptStep";
// internal ID. Must be unique
123;
// name of script step
"Concat";
// XML definition of parameters
"<PluginStep>
    <Parameter Type=\"target\" Label=\"Destination\" ShowInLine=\"true\"/>
    <Parameter Type=\"calc\" DataType=\"text\" ShowInline=\"true\" Label=\"FirstName\" ID=\"0\"/>
    <Parameter Type=\"calc\" DataType=\"text\" ShowInline=\"true\" Label=\"SecondName\" ID=\"1\"/>
</PluginStep>";
// calculation
"MBS(\"Plugin.ScriptStepParameter\"; 0) & MBS(\"Plugin.ScriptStepParameter\"; 1)";
// description
"Concat two texts" )

Saxon

We have done a lot for Saxon in the last few releases. To help you better manage your licenses, we have now added the new Saxon.LicenseeName function so that you can query directly from FileMaker to whom, the license you are using, has been licensed. In this release we also have updated the Saxon library to version 12.8.

Mac

There are also new features for Mac and the iOS SDK

File dialog

You have been able to trust our dialogs for saving and importing for years. Now we have prepared another property for the save dialog that you can set by yourself. You can now decide whether to allow the user to create a new folder when they want to save a file. With the function FileDialog.SetCanCreateDirectories you can now show and hide the New Folder button in the Save dialog. It is shown by default.

MBS15.3_B3.png

Goodies

There are also new features in the developer goodies. First, you can set whether scrolling should be allowed in the debugger. You can use the SyntaxColoring.DebuggerScrolling.SetEnabled function to configure this. You can also change the background color of your script workspace. The ScriptWorkspace.SetBackgroundColor function is available for this purpose. This function can be useful if you have two different worksapaces and want to differentiate between them, or if you find a different color more pleasant to work with.

MBS15.3_B4.png

You can now also move rows up or down in the calculation editor using the "Control up" and "Control down" shortcuts. The blog article Control keys to move lines up and down shows you this function in more detail.

We also have a button in the data viewer's detail view to format a JSON or XML text for a better overview. If you want to get more information about this, please have a look at our blog article A format button for the data viewer.

DataViewerFormat3.png

Sharing Service

For some years now, we have been able to share files and other things using Apple's built-in sharing function. We would now like to expand this area with the SharingService.ShareValues function. This works in a similar way to the SharingService.ShareItems function that has been known for years. In comparison to the old function, the new function does not accept file paths or URLs. This allows you to limit sharing.

System Info

If you want to know whether your solution is running on a Mac with the latest Apple operating system, macOS 26 Tahoe, you can use the SystemInfo.isTahoe function. This returns a 1 if we are on the Tahoe system. Otherwise a 0.

The new function SystemInfo.AppResourceUsageStatistics retrieves detailed resource usage statistics for the current process. It fills a versioned usage info structure with metrics such as CPU time, memory footprint, disk I/O, and energy usage.

See blog post: Check how much disk I/O a script step causes

Windows

Last but not Least we also have news for Windows user.

Round corners for windows

You don't like the corners of your window and would like to round them off. You can do this with the Window.SetRoundCorners function. This function is e.g. great to make round corners for card windows. (macOS and Windows in FileMaker Pro, not for Web Direct)

We also have the new functions Window.SetWindowDisplayAffinity and Window.GetWindowDisplayAffinity. With the Set function we set the window display affinity that specifies where the content of the window can be displayed. It is designed to support the window content protection feature that is new to Windows 7. This feature enables applications to protect their own onscreen window content from being captured or copied through a specific set of public operating system features and APIs.

Search function

Independently of this release, we have a new feature on our website that we would like to draw your attention to. We have added a new search function to the website to help you use the functions of our plugin and find blog articles on specific topics more quickly. You can now go through our website by entering search terms and find the functions and information you need for your project more easily. You are welcome to try it out.

MBS15.3_B5.jpg

Here you can find components, functions and even some blog articles to explain them.

We hope you will also find some interesting new features. We wish you a lot of fun with MBS FileMaker Plugin Version 15.3. If you need a license or have any questions, please contact us.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.