« MBS @ FMTraining.TV -… | Home | MBS @ FMTraining.TV -… »

New in MBS FileMaker Plugin 14.1

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

Overlay

Let's start with the new component that has been added to our plugin: Overlay. Using the functions of this component, you can display a graphical overlay in your window, completely independently of layout elements and you can interact with this overlay. First you create a new overlay with Overlay.Create function. We store the returned reference number and use it for the other functions.

We can specify the position in different ways. On the one hand, we can use a layout object as a size and position reference, which helps us, for example, if we want to frame a button on the layout red. Here we use the function Overlay.SetFrameWithControl and enter the window ID and the name of the control in addition to the overlay reference. If we do not want to display our overlay directly on the layout object or slightly larger, we can enter an offset and the extra width and height in additional parameters.

With the function Overlay.SetFrame we can specify a fixed position and size.

The Overlay.SetImage is probably one of the most important functions because you use it to set the overlay graphics. These graphics can have the formats JPEG, PNG, TIFF and BMP, among others. We prefer PNG for small size and supporting transparency. With Overlay.SetVisible we then make this overlay visible and can also hide it again with the same function.

These and many other possibilities are available to you with our new component Overlay. If you are further interested in the topic, please also read our blog article Overlay windows for FileMaker and have a look on the new example Overlay.

JSON

The two functions JSON.AddValueToArray and JSON.AddValueToObject provide an improvement in working with JSON. With the JSON.AddValueToObject function, you can easily add one or more new entries to an object.

MBS( "JSON.AddValueToObject"; "{}"; "Hello"; "World"; "test"; 123; "a"; "abc")

Example result:
{
	"Hello":	"World",
	"test":	123,
	"a":	"abc"
}

Similarly with JSON.AddValueToArray, where we add an entry to an array instead of an object.

Set Variable[ $JSON ; Value: "[\"apple\", \"kiwi\", \"mango\"]" ]
Set Variable [ $Array ; Value: MBS( "JSON.AddValueToArray"; $JSON; "pomelo";"orange" ) ]

Result: 
["apple", "kiwi", "mango", "pomelo", "orange"]

DynaPDF

While we are on the subject of JSON, I would like to introduce you to the new DynaPDF.GetActionsAsJSON function. This lists all actions that occur in this PDF. These can be JavaScript or GoTo actions, for example. We also have a new action that we can create in a PDF. The new function DynaPDF.CreateGoToEAction creates an embedded GoTo action. This action type opens an embedded PDF file that is located in the current, parent, or in an external PDF file. Embedded files can be attached directly, e.g. with DynaPDF.AttachFile, or embedded in file attachment annotations with DynaPDF.FileAttachAnnot.

In Release 14.0 we have already introduced you to some new parser functions. With the new function you can output the text and its length current selection or found text.

RemoteControl

In the RemoteControl topic we have added some functions that can check if a certain button is pressed. This allows you, for example, in a script that is triggered by pressing a button, that we can make specific distinctions in a script. We have added the following functions for the corresponding buttons:

GM Image

There is also a new feature in the GraphicsMagick area: GMImage.Statistics. This function calculates statistics for an image. GMImage.Statistics computes common statistics (currently maximum, minimum, mean and standard deviation) for the available image channels. The per-channel values are returned in an ImageStatistics structure as JSON. For example, we have this image:

The picture gives us the following statistics :

{
	"red":	{
		"maximum":	1,
		"minimum":	0,
		"mean":	0.538055,
		"stddev":	0.307104,
		"variance":	0.094313
	},
	"green":	{
		"maximum":	1,
		"minimum":	0,
		"mean":	0.540072,
		"stddev":	0.287247,
		"variance":	0.082511
	},
	"blue":	{
		"maximum":	1,
		"minimum":	0,
		"mean":	0.553617,
		"stddev":	0.283935,
		"variance":	0.080619
	},
	"opacity":	{
		"maximum":	0,
		"minimum":	0,
		"mean":	0,
		"stddev":	0,
		"variance":	0
	}
}

ListDialog

In the new release, we also have a new option for closing the ListDialog. If you call the function ListDialog.SetCloseDialogOnDoubleClick with the value 1 before, you can close the list dialogs with a double-click. The value 0 in the same function deactivates this function. If you want to know whether the function is currently activated, call the ListDialog.GetCloseDialogOnDoubleClick function.

Clipboard

Since one of the earliest versions, we already have clipboard functions that allow us to work with the clipboard. In this release, we have now also added a clipboard function that deletes the entire contents of the clipboard. So if you want to enjoy a fresh start with the clipboard, use the Clipboard.Clear function.

Mac and iOS

There are also new features for Mac and the FileMaker iOS SDK.

Syntax Coloring

If you format a formula in a FileMaker with our ƒ button in the formula dialog, you can hold down the option key to get a compact display.

Use SyntaxColoring.FormatCalculation to call our formatting code for your own formulas stored in fields. You can use various extensions of the formatting code. If you use the context menus to copy an entry in a list of fields, our context menu now offers you the option of copying the complete field specification.

Events

New functions for requesting authorizations have been added for events. With the function Events.RequestFullAccessToEvents you can prompt for grant or deny read and write access to event data. Similarly, Events.RequestWriteOnlyAccessToEvents queries the authorization for write access only to event data. The function Events.RequestFullAccessToReminders requests the authorization for reminders.

All these dialogs the operating system only prompts them the first time your app requests corresponding event accesses

AVRecorder

With the new AVRecorder.SetVideoOrientation function, you can set the orientation of the camera. You can choose between PortraitUpsideDown, Portrait, LandscapeLeft, or LandscapeRight. If the device is rotated, you may need to adjust the orientation. You can use the new AVRecorder.GetVideoOrientation function to find out which orientation is currently being used.

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

Claris FileMaker Plugin
19 03 24 - 07:10