« dotfmp 2022 | Home | MBS FileMaker Plugin,… »

New in MBS FileMaker Plugin 12.0

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

WebHook

We have already introduced the WebHook component in the last release. It makes the connection between devices or systems that support the WebHook technology and your FileMaker application possible. In this release we added a few more functions to support you when working with WebHooks.
Our WebHook functions got a new timeout property to prevent connections staying open forever without sending a request. You can set the time for the TimeOut yourself. To do this, use the new WebHook.SetTimeOut function. The default value is 5 minutes. The time is specified in seconds. With the WebHook.GetTimeOut you can query this value again. Furthermore you can use WebRequest. GetState to get the current state of a web request. As return we get a number between 0 and 3 which have the following meanings:

  1. freshly allocated
  2. connection received
  3. data arrived
  4. processed
If you use WebHook.Check, you may only see requests with state 3, but if you use WebHook.List, you may see earlier states like 1 and 2.

FM

Now let's move on to the new features in the FM component. We have a new function FM.ExecuteFileSQLValue. With it we can make a SQL query to our FileMaker database just like with the FM.ExecuteFileSQL function. Compared to the older function, the new function only returns the value of the first result. The function preserves the data type, so numbers, containers and time/date values are not converted to text.

In the component we have now also three functions related to ValueLists. With FM.ValueListNames we can list the names of the value lists in the current file. If we have the name of a value list we can find out the matching ID with the function FM.ValueListIDForValueListName. Exactly the opposite works the FM.ValueListNameForValueListID function which gives us a name for an ID. By the way, the last two functions do not only have to refer to the current file, but can also be called on other files by specifying the file name in the parameters of the function.

Progress Dialog

Appearance often matters in life, including in programs. For this reason we have developed the new function ProgressDialog.SetPositionWindowCentered for Mac and Windows, which positions the progress dialog in the center of a window. You can specify the window in which the dialog should be displayed in the center as a reference in the parameters. You can also move the window by specifying an X and Y offset proportional to the center position.

Mac

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

Events

We have a new function for the Mac and the iOS SDK from the Events component. You can now get the matching contact data for a birthday that is entered automatically from the address book in the calendar. For example, you can have the daily birthday child auto-determined and its contact information is displayed.

A script could look like this:

Set Variable [ $ID ; Value: MBS( "Events.Calendar.CalendarIdentifier"; "Birthdays" ) ] 
Set Variable [ $BirthdaysOfTheDay ; Value: MBS( "Events.Events"; Get ( CurrentTimestamp ); Get ( CurrentTimestamp ) + 24 * 60 * 60; $ID ) ] 
Set Variable [ $r ; Value:  GetValue ( $BirthdaysOfTheDay ; 1 ) ] 
Set Variable [ $Contact ; Value: MBS( "Events.Event.BirthdayContactIdentifier"; $r) ] 
# 
Set Variable [ $r ; Value: MBS( "CNContact.Show"; $Contact ) ] 
Set Variable [ $Name ; Value: MBS( "CNContact.Name"; $Contact) ] 
Set Variable [ $Mail ; Value: MBS( "CNContact.MailingAddress"; $Contact) ] 
Show Custom Dialog [ "The birthday child" ; "Name: "& $Name &  "¶Address: " &$Mail ] 

Files

The component Files has also got new functions for Mac users, because you can now check and set if the file extensions should be hidden for a certain file or in a whole folder. For this you can use the Files.IsFileExtensionHidden and Files.SetFileExtensionHidden function. Furthermore, you can use Files.SetExcludedFromBackup to exclude a file or folder from backup. With Files.IsExcludedFromBackup you can also query this status.

Extension of our goodies

We have also extended our free developer features for Mac users. This is the moment some of you have been waiting for a long time, because it was often requested from us. We have integrated the autocompletion of variable names. The list of variable names is displayed in a popup menu when you type a $ sign in the formula editor. You can then select a variable from this list. If you enter more than one character, the list will be narrowed down further. The autocompletion works also for Global Variables if they are initialized in the same script or if they are initialized in the script with @variable followed by the variable name in a comment. This tool will be very useful for writing scripts. For Let-statements we can additionally auto complete local variable names starting with ¢ (cent), _ (underscore) and ~ (tilde) characters. We also have another new feature in the formula editor. We have now included the buttons for syntax checking and test output in a button bar that has two new buttons, which are labeled +TO and -TO. The TO stands for Table occurrence. This means that we can switch off and on the display of the table association to a field name in the formula editor by pressing a button. Especially with long table names the hiding makes sense, because it makes the formula clearer.

Alternate Font Lists For DynaPDF under Windows

There are also innovations in the DynaPDF area for Windows users. Sometimes it can be quite difficult to display fonts the way you want them to be displayed, especially when there is the factor of two different output languages. You can now create an alternate font list.

These glyphs are used when the desired font cannot be used. Multiple lists can be created because different fonts and languages require different fallback fonts. For example, one could create a list for proportional fonts and another one for fixed pitch fonts, or different lists for different languages. Each list can be activated or deactivated with DynaPDF.ActivateAltFontList as often as you like. Changing the active alternate font list is very fast and causes no overhead. Once a font list was created it can be filled with data with DynaPDF.SetAltFonts. A font list that is no longer needed can be deleted with DynaPDF.DeleteAltFontList. Please note that alternate font lists are used only, if complex text layout was enabled. This can be done by setting the flag ComplexText with DynaPDF.SetGStateFlags. Alternate font list are tested if one more glyphs were not found in the current font. Since the fonts in the list are used as fallback they should be compatible to the active font in regard to properties like serif, sans serif, proportional or fixed pitch, and so on. A list should be sorted by priority and not by name. That means index 0 should contain a font name that is most probably the best match. If this one was not available or incompatible then the next font in the list will be tested until the end of the list was reached. If no suitable font was found then system fonts are tested. The fonts in the list should support the language that must be output. Otherwise, the fonts can never be selected. An alternate font list can be arbitrary large but it is usually best to restrict the number fonts in a list to speed up processing.

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

Claris FileMaker Plugin
31 01 22 - 12:56