The state of curl 2020

Daniel Stenberg tells what's the state of CURL tool/library.



See on the CURL video website and watch on Youtube.
We use CURL extensively for our MBS Plugins and visited the CURL Up conferences in the past. We look forward to a conference next year to meet the CURL community again.

FreeTDS 1.1.33 Libraries

Today we managed to build new FreeTDS libraries for you.
Those are based on FreeTDS version 1.1.33 from FreeTDS.org website:

FreeTDS is a set of libraries for Unix and Linux that allows your programs to natively talk to Microsoft SQL Server and Sybase databases.

Technically speaking, FreeTDS is an open source implementation of the TDS (Tabular Data Stream) protocol used by these databases for their own clients. It supports many different flavors of the protocol and three APIs to access it. Additionally FreeTDS works with other software such as Perl and PHP, providing access from those languages as well.

If you are looking for a Java implementation, we refer you to the jTDS project on SourceForge.

FreeTDS has many possible uses. It has been used by Unix/Linux webservers to present data stored in SQL Server to the web, to port SQL Server database code from NT to Unix, to import data into SQL Server from a Unix source, and to provide database access on platforms (such as realtime systems) that have no native drivers.

The FreeTDS C libraries are available under the terms of the GNU LGPL license. Consult COPYING.LIB in the distribution for details.

Download: FreeTDS 1.1.33.dmg and FreeTDS 1.1.33.zip

We use this library in MBS Plugins to connect to Microsoft SQL Servers from MacOS and Linux.
Supporte platforms in this download include Mac 32/64bit, Linux 32/64bit for Intel/ARM and iOS for both simulator and device.

MBS Birthday Sale ends tomorrow

We celebrate in April 2020 the 20th anniversary of our company. The month is almost over. We got congratulations from hundreds of people, quite a few orders with the discount applied and we had a great birthday cake. Thank you all!



We hope to see a lot of clients and friends at the party next year. Invitations will go out in January for the new date.
If you need a license, get it today or tomorrow with the 20% discount applied.

Have a great spring time at home, stay healthy and see you at the next conferences!

Basic Forms in MBS Xojo SceneKit Plugin

In this article I would like to give you a short introduction to the SceneKit topic. SceneKit is a powerful graphic engine supplied by Apple as a framework and using the Metal Engine for 3D Graphics. SceneKit is available for Xojo under MacOS with the MBS Xojo Mac64bit Plugin.

Geometrical objects can be composed of basic forms. The following basic forms are available: sphere, cylinder, capsule, truncated cone, tube, torus, box, infinity plane, plane, and the pyramid.

Each of these basic forms has its own class with its own properties. Now we will looking at the constructors of the individual forms.


Here you can see the basic forms. The red bar passes through the origins of the forms)

Sphere
From an article previously published on the blog, in which we modeled together our solar system, some of you already know the basic form sphere that uses the class SCNSphereMBS. In the constructor the value for the radius is passed.

Cylinder
In the constructor of the class SCNCylinderMBS class we define the radius and the height of the cylinder

Capsule
For the creation of a capsule we use the SCNCapsuleMBS class. The capsule is a basic form, although it could also be assembled from two spheres and a cylinder. So it is not surprising that for the creation of this basic form, the radius of the capsule tip and the height of the capsule is needed.

Cone and truncate cone
For modeling a cone or a truncate cone we need the class SCNConeMBS. We define the radius of the upper surface and the lower surface, as well as the height. This results in a truncated cone. If we define the upper radius as 0, we get a perfect cone.

Tube and torus
We have also become familiar with the basic tube shape in the solar system project. In the last project we use the object of the class SCNTubeMBS to modeled the ring of Saturn. The tube is defined by an inner radius, an outer radius and height. The inner cylinder is subtracted by the outside cylinder.

This basic shape is easily confused with the torus basic shape, because both are round and have an opening in the middle. But if you cut a torus, the cut surface is a circle. For the tube, the cut surface is rectangular. The objects of the class SCNTorusMBS are defined by its ringRadius and pipeRadius.

Box
For the box we have the normal parameters width, height and length. Additionally we have an another parameter where we can specify how much our corners should be rounded. Extremely sharp edges gives the animation an unnatural look. Look at a dice for example, its corners are rounded too.

Plane and Floor
The objects of the SCNPlaneMBS class are defined by width and height. Besides the geometry of the normal plane, we also have geometry of an infinite plane. The geometry can be created as an object of the SCNFloorMBS class. The class is called Floor, because it is often used to model a floor or ceiling. It has a property that allows you to set the intensity of the reflection, that ensures that objects are reflected in this floor.

Pyramide
Last but not least we have pyramids. In the constructor of the SCNPyramidMBS class we defined the width, height and length of the pyramid. Our pyramid has a rectangular base. In the middle of this base area is also the center of gravity. This is a special thing about the pyramids. For all other basic shapes it is in the middle of the object. This information is especially important for the positioning in a scene. We will see the positioning of objects in a scene later (more)

Enable HiDPI aware web viewer for FileMaker

With latest pre-release we added the WebView.SetInternetExplorerHiDPI function to switch on the HiDPI aware more for FileMaker application (or runtime). See comparison picture:



In your start script you can just call this function once to enable it:

MBS( "WebView.SetInternetExplorerHiDPI"; 1 )

When this option is active before web viewer is created, the web control will display the content high-dpi aware and zoom to 100% independent of the DPI of the display.

In earlier blog post we recommended to use JavaScript to zoom the website:

MBS( "WebView.RunJavaScript"; "web"; "document.body.style.zoom = \"200%\"; ")

But this is no longer needed on Windows once the web viewer zooms correctly.

PS: For Xojo use IEWebBrowserMBS.SetInternetExplorerHiDPI function to do the same.

MBS Xojo Plugins, version 20.2pr5

New in this prerelease of the 20.2 plugins:
  • Updated OpenSSL to version 1.1.1g.
  • Added constructor to XMLValidatorMBS class to take folderitem.
  • Changed SQLDatabaseMBS RecordSet to pass time, date and timestamp to Xojo with the right type, so Xojo can handle them correctly.
  • Added SetInternetExplorerHiDPI and GetInternetExplorerHiDPI functions to IEWebBrowserMBS class to enable proper resolution handling in HTMLviewer on Windows.
  • Added TextShape class support for Object2D drawing with DynaPDFMBS class's graphics integration.
  • Corrected alignment issues for TextShape/StringShape class handling with DynaPDFMBS class's graphics integration.
  • Added ClearRectMode to DynaPDFMBS class to ignore calls to Graphics.ClearRect and allow background to show.
Download: monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.

MBS FileMaker Plugin, version 10.2pr5

New in this prerelease of version 10.2 of the MBS FileMaker Plugin: Download at monkeybreadsoftware.com/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder.

FileMaker Server Plugin Installation

You have a FileMaker Server installed, e.g. on Windows Server, and you need the MBS Plugin installed. Let us guide you though the installation process.
We expect you have a current FileMaker Server running. If you have an older/newer one, the buttons may be on a different position.

(more)

20th Birthday Cake

We had hired Frederik Leersch, a local cake artisan, to create us a big cake for the 20th birthday party. Sadly the party is moved to next year. But for this year, we changed the order to deliver a few smaller cakes to deliver to our staff:



See sweetcakeart.de to see what Frederik can do: Cake Pictures

ODBC driver and MBS SQL Functions in FileMaker

We have made a ton of example code in the last decade showing how to connect to Microsoft SQL Server from MacOS or Linux using FreeTDS and our MBS FileMaker Plugin. And there are two ways to do it:

1. With loading driver directly

Set Variable [$result; Value: MBS("SQL.SetClient"; $Connection; "ODBC")]
#Tell plugin where freetds library is
Set Variable [$result; Value: MBS( "SQL.SetConnectionOption"; $Connection; "ODBC.LIBS"; "/Users/cs/Desktop/libtdsodbc.dylib")]
#Connect to database
Set Variable [$result; Value: MBS("SQL.Connect"; $Connection; "DRIVER={FREETDS};Server=192.168.2.32;UId=SA;PWD=test;Database=test;TDS_VERSION=7.2;Port=1433")]

As you see, we point to the dylib as ODBC library, load it and connect through it.

2. With loading iODBC and having driver in connection string

Set Variable [$result; Value: MBS("SQL.SetClient"; $Connection; "ODBC")]
#Tell plugin where freetds library is
Set Variable [$path; Value: "/Users/cs/Desktop/libtdsodbc.dylib" ]
#Connect to database
Set Variable [$result; Value: MBS("SQL.Connect"; $Connection; "DRIVER={" & $path & "};Server=192.168.2.32;UId=SA;PWD=test;Database=test;TDS_VERSION=7.2;Port=1433")]

As you see, we let the plugin load libiodbc.dylib (ODBC manager) and then have it load the library.

What is better?

Both ways do work, so for most customers there is no difference. But the second way is better as the libiodbc does some additional services like text encoding conversations, provide additional functions like a directory of the various database drivers, functions to browser for databases and a way to work with data sources.

So we recommend in general that all customers prefer the second way over the ODBC manager to make sure all things work well. For the next weeks, we'll try to update a couple of blog posts and examples projects.

Connect to Microsoft SQL Server with MBS Xojo SQL Plugin

We have made a ton of example code in the last decade showing how to connect to Microsoft SQL Server from MacOS or Linux using FreeTDS and our MBS Xojo SQL Plugin. And there are two ways to do it:

1. With loading driver directly:

Some example code using SQLDatabaseMBS, but may look very similar with SQLConnectionMBS class:

Dim libtdsodbc as Folderitem = FindFile("libtdsodbc.dylib")
Dim cs as string = "DRIVER={FREETDS};Server="+Server+";UId="+User+";PWD="+Pass+";Database="+DatabaseName+";TDS_VERSION=7.2;Port="+Port
db.SetFileOption db.kOptionLibraryODBC, libtdsodbc
db.Option("UseAPI") = "ODBC"
db.DatabaseName = "ODBC:"+cs

As you see, we point to the dylib as ODBC library, load it and connect through it.

2. With loading iODBC and having driver in connection string

Dim libtdsodbc as Folderitem = FindFile("libtdsodbc.dylib")
Dim cs as string = "DRIVER={" + libtdsodbc.nativePath + "};Server="+Server+";UId="+User+";PWD="+Pass+";Database="+DatabaseName+";TDS_VERSION=7.2;Port="+Port
db.Option("UseAPI") = "ODBC"
db.DatabaseName = "ODBC:"+cs

As you see, we let the plugin load libiodbc.dylib (ODBC manager) and then have it load the library.

What is better?

Both ways do work, so for most customers there is no difference. But the second way is better as the libiodbc does some additional services like text encoding conversations, provide additional functions like a directory of the various database drivers, functions to browser for databases and a way to work with data sources.

So we recommend in general that all customers prefer the second way over the ODBC manager to make sure all things work well. For the next weeks, we'll try to update a couple of blog posts and examples projects.

Use formatted text in Excel files with FileMaker and LibXL

With the recent release of LibXL 3.9, we got new functions for working with styled text. For our MBS FileMaker Plugin, we added new functions for styled text:
Now you can pass directly styled text from a field in FileMaker to a cell in an Excel document. Or you build a styled text from scratch with text formatting functions in FileMaker like in the example below:

# create sheet
Set Variable [ $sheet ; Value: MBS( "XL.Book.AddSheet"; $book; "Styled Text Test") ]
#
Set Variable [ $row ; Value: 1 ]
Set Variable [ $col ; Value: 0 ]
Set Variable [ $text ; Value: TextColor ( TextSize ( "Red"; 15 ) & " Text" ; RGB ( 255 ; 0 ; 0 ) ) & TextColor ( TextSize ( " and blue"; 14 ) ; RGB (0 ; 0 ; 255 ) ) & " in FileMaker" ]
#
Set Variable [ $r ; Value: MBS( "XL.Sheet.CellWriteStyledText"; $book; $sheet; $row; $col; $text) ]
#
Set Variable [ $text ; Value: TextFont ( TextStyleAdd ( "Hello World" ; Bold+Underline+Italic ); "Calibri" ) ]
Set Variable [ $row ; Value: 2 ]
Set Variable [ $r ; Value: MBS( "XL.Sheet.CellWriteStyledText"; $book; $sheet; $row; $col; $text) ]

In our example database we show the styled text in two fields to check if we got them right:

For the conversion to/from styled text, we support passing font name, color, size and the following styles: bold, italic, strikethrough, single/double underline, subscript and superscript. Optionally, you can attach a format to the cell, which may define the alignment and other formatting options. We hope you enjoy this functions and use them to post process the Excel exports from FileMaker or code your own export from scratch via script.

Please try the new functionality and don't hesitate to contact us with questions. This is already included in 10.2pr4 download.

StyledText for Excel files with LibXL 3.9 in Xojo

We recently moved to LibXL version 3.9, which adds support to styled text for use in Excel files. We added a new XLRichStringMBS class to have all the options available within the LibXL library. But we also added support for working with StyledText class directly. You can just pass the styled text from a TextArea control directly to be used to set a cell in your document. Same for reading, where we translate the styles back. Here is an example to write a cell:

Dim st As New StyledText Dim row As Integer = 2 Dim col As Integer = 0 st.Text = "Red Text blue" st.TextColor(0, 8) = &cFF0000 st.TextColor(9, 4) = &c0000FF st.Size(0,4) = 15 Call sheet.WriteStyledText row, col, st row = 3 st = New StyledText st.Text = "Hello World from Xojo" st.Italic(0,11) = True st.Bold(0,11) = True st.Underline(0,11) = True st.Font(0,11) = "Calibri" st.Bold(12,10) = True Call sheet.WriteStyledText row, col, st

The XLRichStringMBS class allows you to use a XLFontMBS class with the following styling properties to be used: color, italic, bold, single/double underline, strikeout, font name, sub/superscript and font size. Converting from StyledText we pass through bold, italic, underline, font name, size and color. When you call WriteStyledText, you can optionally include a format object, which defines e.g. alignment.

Please try the new functionality and don't hesitate to contact us with questions. This is already included in 20.2pr4 download.


Digitally signing PDF with DynaPDF and custom signature appearance

For some time now we can sign PDFs with DynaPDF functions automatically in a script in FileMaker. For next pre-release we add a new feature to add a custom signature appearance. You define in your script how the PDF draws the signature on the page and includes the validation icon. That validation icon is a special feature of the PDF reader where they draw a checkmark to let you know the signature is valid. Like this screenshot:



We draw in the box there to show it's signed, write the name there and then tell the PDF viewer to place the icon left to the text. If the PDF viewer doesn't know or doesn't check, this should display a question mark. See picture on the right.

To do this, you do three steps:
  1. You call DynaPDF.CreateSigField to create a signature field on the PDF and specify the coordinates. You choose where to put it on the page and yes, you can render various areas and look for white space.
  2. To place the validation icon, please use our new DynaPDF.PlaceSigFieldValidateIcon function. This receives relative coordinates within the signature field rectangle.
  3. Then use DynaPDF.CreateSigFieldAP to create a custom signature field appearance stream and draw some text into it. You draw what you like within the given rectangle of your signature and the icon is later placed on top over the custom drawing. Please call DynaPDF.EndTemplate when done with the drawing.
Now you save the PDF and use our DynaPDF.SaveAndSignFile function to provide the file path to the private key file and let the plugin close the file with valid signature.

PS: Also available for Xojo with DynaPDFMBS class, see signature appearance project.

MBS FileMaker Plugin Examples Videos

Stefanie Juchmes made two videos where she walks though example files on MacOS and Windows.
Thumbnail

MBS FileMaker Plugin Examples Windows (English)

Thumbnail

MBS FileMaker Plugin Examples MacOS (English)

For more presentation videos see the other videos


MBS Xojo Plugins, version 20.2pr4

New in this prerelease of the 20.2 plugins:
  • Added JavaScript LibPhoneNumber example to validate and format phone numbers
  • Updated DynaPDF to version 4.0.38.110.
  • Deprecated OpenSpecialData method in PNGReaderMBS class.
  • Reduced dependencies for Photos plugin part to not need AVFoundation and MacFrameworks.
  • Updated LibXL to version 3.9.
  • Added XLRichStringMBS class to work on rich text in Excel documents.
  • Added StyledText functions for XL Plugin.
  • Updated plugin SDK to version for Xojo 2020r1
  • Deprecated all Mac 32-bit HTMLViewer extension classes for Xojo before 2020. For Xojo 2020 those are removed.
  • Added setter for AVCaptureDeviceMBS.activeInputSource property.
  • Enabled SSPI, Kerberos 5 and SPNEGO for CURLSMBS class on Windows.
  • Fixed returning of date in RecordSet with SQLDatabaseMBS, broken in pr1.
Download: monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.

MBS FileMaker Plugin, version 10.2pr4

New in this prerelease of version 10.2 of the MBS FileMaker Plugin: Download at monkeybreadsoftware.com/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder.

Using libPhoneNumber for phone number formatting

Recently a client asked whether we could integrate the libPhoneNumber library into the plugins. Well, it's a big C++ library with a lot of dependencies and it looks like building a static version for our plugin or a DLL version to load at runtime is a bit tricky. But we found the JavaScript port of the library on the same website. This one has a couple of dependencies, but it can be compiled into a single file version with all required libraries embedded in one JavaScript file.

As you may know we introduced a JavaScript engine into our plugins last December for both FileMaker and Xojo. This JavaScript engine is capable to load the standalone version of libPhoneNumber and execute queries to work with phone numbers. Let us look at a few examples. First you load the library and initialize everything. Then you query for example the intlTelInputUtils.formatNumber function to format a number:

intlTelInputUtils.formatNumber('01751234567', 'DE', intlTelInputUtils.numberFormat.INTERNATIONAL)

The result is "+49 175 1234567", which formats the number for international use with spaces in-between for humans. All javaScript functions used here are in the intlTelInputUtils namespace, so all function names have this as prefix. The formatNumber function itself takes three parameters with the number, the country code and the format. Possible formats are given as constants in JavaScript, so you can pass here E164, INTERNATIONAL, NATIONAL or RFC3966. The last one is the tel: URL for use in links on a website. For our test number, we would get "+491751234567" for E164, "0175 1234567" for NATIONAL and "tel:+49-175-1234567" for RFC3966.

(more)

New physics classes for SceneKit in Xojo

Stefanie recorded a short video about the new physics classes in SceneKit with the example and talks how it works:

See also:


Vote for FileMaker Plugin SDK Ideas

As you may know FileMaker comes with a plugin SDK, which C++ developers like me use to develop plugins. Now the Plugin SDK offers a way to register functions and script steps and provide additional features to the FileMaker developer.

The plugin developer can get a list of parameters with the function call and inspect them, e.g. do different things for containers, texts or numbers passed in. And the plugin can return a value as result and the SDK offers functions to return texts, numbers and assemble containers. Over the years we got a few SQL functions to do queries and modify data in the database on behalf of the FileMaker developer. With the evaluate function in the SDK, we can call Get(Functions) or do calculations.

From a plugin we can trigger a script. That means the script call is put on a queue and executed later after the current script finished. But for some reason, we can't trigger a script on FileMaker Server. The plugin SDK doesn't provide the functionality to do this.

In the plugin we can work with styled text stored in FileMaker fields. We use that to format JSON and XML text now. But we can't access alignments in a styled text.

So as a plugin developer I submitted a few ideas over time:
Please vote for them if you like. Claris Inc. may look right now what to deliver in 2020 and we would appreciate if something would be picked based on popular vote.

Those ideas could help to make a better plugin SDK, which may lead a dozen plugin developers to make better plugins, which hundreds of FileMaker developers could use in thousands of solutions.

PS: Fixed links to point to new Claris community.

Half way through April and our MBS Birthday Sale

So far a couple of people updated their licenses, some even for 5 years. Thank you.

We are half through April, so our sale has another 14 days left.
If you have a license about to expire or just expired a few months ago, just order an update if you like. We really do encourage everyone to take advantage of it and make sure you have all your licenses updated to current versions. The 20% discount with coupon code 20years is a gift to all our users.

For everyone with licenses expired before 6/2019, it is usually cheaper to buy a new one with discount instead of a multi year update.

If you have an older license, you don't need any more and you don't want to get reminder emails about, please let us know so we can mark the email to not get newsletters.

See also MBS Birthday Sale and FAQ for our Birthday Sale.

Adding NSURLSession classes for Xojo

For the current prerelease version 20.2pr3 we added NSURLSessionMBS and related classes to the MBS Xojo Plugins. Main reason is that we urgently needed a solution for a client to support HTTP/2 connections for a project. Long term plan is to add HTTP/2 to our CURL plugin someday, but for now it is easier to just leverage Apple's excellent NSURL Frameworks which do the heavy work for almost all network traffic in MacOS & iOS. The classes allow you to use the latest encryption settings automatically.

When using the classes, please first create an object of NSURLSessionConfigurationMBS class. Configure it to the options you need, e.g. what caching or cookie policies you like or whether to allow cellular or expensive connections.

Next you can initialize a new NSURLSessionMBS, usually via constructor and your own subclass to fill in the events. Alternatively for simple transfers you can use the sharedSession and use the default settings.

Then you use one of the NSURLSessionTaskMBS subclasses:Please try the new classes soon and let us know if you have any problems using them.

We formally deprecate NSURLConnectionMBS class, which is the older set of classes Apple provides for HTTP connections. You should move to NSURLSessionMBS soon. We won't remove them until Apple removes them, but you never know whether they will be part of next OS version.

MBS FileMaker Plugin, version 10.2pr3

New in this prerelease of version 10.2 of the MBS FileMaker Plugin: Download at monkeybreadsoftware.com/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder.

MBS Xojo Plugins, version 20.2pr3

New in this prerelease of the 20.2 plugins: Download: monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.

Sort with evaluate in FileMaker

We got a few new functions to sort lists: List.SortWithEvaluate, QuickList.SortWithEvaluate and JSON.SortWithEvaluate.

The idea is to pass an expression to do the comparison for the sort operation. This way you can use functions like for example GetAsNumber() to convert from text to number.

If you run the function with simply comparing leftValue and rightValue like this:

MBS("List.SortWithEvaluate"; "1¶22¶3"; "leftValue < rightValue")

You get the list back with 1, 22 and 3. But if you use GetAsNumber(), you define the order for numbers like this:

MBS("List.SortWithEvaluate"; "1¶22¶3"; "GetAsNumber(leftValue) < GetAsNumber(rightValue)")

The list is now returned as 1, 3 and 22.

This function can handle various things including sorting by date with GetAsDate(), sorting only text after first 5 characters with Middle() function or do various other operations as needed.

Finally we applied the same technique to JSON with our new JSON.SortWithEvaluate function. You can sort array values here and do the JSON comparison in the expression by using built-in JSON functions in FileMaker or our MBS JSON functions. Here an example sorting a JSON array:

MBS( "JSON.SortWithEvaluate"; "[2,9,3,1]"; "MBS( \"JSON.GetValue\"; leftJSON) < MBS( \"JSON.GetValue\"; rightJSON)" )

Next an example to sort objects by a value of a key within each object. For example if you have records with a name as one of the fields, you can now sort by the field name:

MBS( "JSON.SortWithEvaluate"; "[
    {\"name\": \"Joe\"},
    {\"name\": \"Anna\"},
    {\"name\": \"Tim\"},
    {\"name\": \"John\"}
    ]"; "JSONGetElement ( leftJSON; \"name\") < JSONGetElement ( rightJSON; \"name\")" )

The expression can combine multiple comparisons to look e.g. on first and last name. The following expression would look first if last name is the same and then compare first name:

If (JSONGetElement ( leftJSON; \"lastName\") = JSONGetElement ( rightJSON; \"lastName\");
    JSONGetElement ( leftJSON; \"firstName\") < JSONGetElement ( rightJSON; \"firstName\");
    JSONGetElement ( leftJSON; \"lastName\") < JSONGetElement ( rightJSON; \"lastName\") )

If you do the standard sorting, our List.Sort, QuickList.Sort and JSON.Sort functions will be much faster. But this is for maximum flexibility. If needed we could put in some optimization of course for the future.

Watch XDC 2020 and 2019 videos

While staying at home, how about watching some videos for sessions from XDC 2019 and 2020?
Although the conference was cancelled this year, some sessions got recorded and may be worth to watch.

XDC 2020

XDC 2019

MBS Videos & MBS Youtube playlist

Additional videos may be added to the Youtube playlists later.

Trigger FileMaker Scripts from JavaScript in FileMaker without fmp URL

Did you know you can have a callback from JavaScript in a web viewer in FileMaker without using FMP URL scheme?

For MacOS and iOS in FileMaker 16 or newer, you can use the WebKit message handler feature. First you call Webview.AddScriptMessageHandler function to register a name:

MBS( "Webview.AddScriptMessageHandler"; Name )

Next you can use it in Javascript to trigger a script in FileMaker from JavaScript:

window.webkit.messageHandlers.test.postMessage({'filename':'WebView Message Handler.fmp12', 'parameter':'Hello World from JavaScript', 'scriptName':'test'});

And you can evaluate an expression in JavaScript:

window.webkit.messageHandlers.test.postMessage({'evaluate':'MBS( "Msgbox"; "Hello from Evaluate in JavaScript" )'});

As you see, we get for our message handler a new entry in the namespace called window.webkit.messageHandlers.test. This allows us to call postMessage method there and this triggers the plugin code to trigger scripts or do evaluation. The parameter to the postMessage must be a Javascript object with a few properties:
  • fileName: The name of the file with the script.
  • scriptName: The name of the script to trigger.
  • parameter: The parameter to pass to the script.
  • evaluate: The expression to evaluation.
This works nice for 2 years now and we'd love to see what you can do with this technique.

You can define a JavaScript function to wrap this and install it with WebView.RunJavaScript into the web viewer or include it in the html document:

function CallFileMaker(FileName, ScriptName, Parameter)
{
    window.webkit.messageHandlers.test.postMessage({'filename': FileName, 'parameter': Parameter, 'scriptName': ScriptName });
}

Works in FileMaker Pro, Runtimes and in apps based on the FileMaker iOS SDK.

ISO FileMaker Magazin Videos

Matt Petrowsky from the ISO FileMaker Magazine has an amazing library of video content related to FileMaker. You can subscribe on the website and enjoy a lot of tutorials and video talks about learning FileMaker.

Currently for the time of the COVID-19 pandemie he provides a new series on Youtube:

Learning FileMaker: Covid 19 Solution.

We are honored to be mentioned in episode #4 where Matt talks about enhancements in FileMaker provided by MBS Plugin:

Learning FileMaker: Episode #4 - Enhancing your development environment

Enjoy the series and have fun learning FileMaker!

MBS Xojo ChartDirector Plugin Birthday

Just 12 years ago we added the ChartDirector Plugin to our MBS Xojo Plugin collection.
Thanks to Mr. Jason J. Campbell for asking me to add a charts plugin and thanks to Peter Kwan from Advanced Software Engineering Limited for his support over the years and the excellent co-operation.



PS: ChartDirector is the engine used by FileMaker Pro internally for the chart generation as you can see on the included DLLs.

We are Claris Partner

We are now a Claris Partner as we just renewed our FBA membership:

It is already 8 years since we applied for this and being a Claris Partner helps:

The listing on the website as well as recommendations to prospects by Claris employers helps to bring business to your company. You get a discount for license purchase so you can make some money selling your solution bundled with the FileMaker licenses and offer one stop shopping to your clients. You can list your products on the marketplace and use Solution Bundle Agreement if you like to sell a lot of bundles. Access to beta versions, extra training sessions, exclusive partner meetings and a few test licenses are included, too.

If you like to become Claris Partner, you can read more on the FileMaker website.

FAQ for our Birthday Sale

Our birthday sale is a way to give every user a thank you with a 20% price reduction. We really do encourage everyone to take advantage of it and make sure you have all your licenses updated to current versions.

The special offer for 20th birthday of Monkeybread Software ends on 30th April. On 1st May we will remove all notices for it and disable thereafter the coupon codes.

If you have a license expired before June 2019, you could buy a new license with discount as that is usually cheaper than multi year updates.

Purchases going through Paypal should get the discount applied automatically, so the amount shown on Paypal website is the reduced price. If you accidentally paid full price here, we may just refund the 20% or add 3 extra months to the licenses.

For our web shows via Share-It and FastSpring, you can use the coupon code 20years and for most links on our website it should be included automatically.

Government entities or public authorities may just order via email & invoice as usual. We still prefer orders through the web shop with an official credit card as that is processed right away.

If you made a purchase in April without applying the discount, we can offer you to simply extend the license for 3 additional months as often a partial refund is not possible.

You can order multi years updates if you like for up to 5 years. If you buy a new license, you can right after buying the new license also buy the updates.

Finally, thanks for your support and for keeping the company running for another 20 years!

PS: Please make sure your license covers summer 2020, so you get current plugin to use with next FileMaker & Xojo versions.

Physics example for SceneKit in Xojo

In this article I want to show you an example with the physics of SceneKit. The physics functions of SceneKit are available in 20.2 pre-release version of our MBS Xojo Plugins.

In this example two pyramids should hit each other. We will create pyramids that move in the direction of each other. We will not only create two pyramids but several with the help of a timer.

We start with a normal and empty SceneKit Scene. The SceneKit Control is located in the middle of our window. We add a timer to our window and open its action event where we want to insert our code.

First we create our pyramid geometry. Then we place the pyramid as a normal node in the scene with the position (5,0,0) on the right side. We repeat it with the second pyramid and place it at the point (-5,0,0) on the left side:

Dim PyramidGeometry As New SCNPyramidMBS(1, 1, 1)
PyramidGeometry.firstMaterial.diffuse.contents = NSColorMBS.redColor
Dim Pyramid1 As New SCNNodeMBS(PyramidGeometry)
Pyramid1.Position = New SCNVector3MBS(5, 0, 0)

Dim Pyramid2 As New SCNNodeMBS(PyramidGeometry)
Pyramid2.Position = New SCNVector3MBS(-5, 0, 0)

Then we create another pyramid geometry. We use this one to assign the nodes physical shape. This physical shape does not necessarily have to be the same geometry as the node. For example you can use the shape of a sphere. In this case the node would be displayed as a pyramid in the scene, but would physically behave like a sphere.

But in this example we want the pyramid to behave physically like a pyramid, too.

Dim phGeometry As New SCNPyramidMBS(1, 1, 1)

Then we connect in the property physic Body of the nodes to the physical shape.

Pyramid1.physicsBody = New SCNPhysicsBodyMBS(1, New SCNPhysicsShapeMBS(phGeometry))
Pyramid2.physicsBody = New SCNPhysicsBodyMBS(1, New SCNPhysicsShapeMBS(phGeometry))

Then we have to indicate how our pyramids should move. That means what is the start impulse the pyramids get. So we set the vector with the direction of motion. If we would only set values on the y-axis, our pyramid would first be moved upwards and then would fall down without an arc. If we additionally specify an x-vector we see that an arc movement is created. This is because the object moves forward with a certain force. During the flight the force decreases, so that the object falls down after reaching the peak.



With the method applyForce we set the previously defined vector.

Dim force1 As New SCNVector3MBS(-10, 10, 0)
Dim force2 As New SCNVector3MBS(10, 10, 0)
Pyramid1.physicsBody.applyForce(force1, True)
Pyramid2.physicsBody.applyForce(force2, True)

You can also specify other physical properties such as the mass of a node and see what effect this property has.

Pyramid1.physicsBody.mass = 3.2

Finally we insert the nodes into our scene and make settings for the timer.
If we now run our application we see that the pyramids influence each other' s fall


I wish you a lot of fun with the new physics functions in SceneKit. The example is included with 20.2 pre-release version of MBS Xojo Plugins.
by Stefanie Juchmes

Convert a SVG image to PNG with alpha channel

You can use GraphicsMagick functions in MBS FileMaker Plugin to convert a SVG to a PNG image with transparency.

To assist there we add a new GMImage.ReadFromContainer function to our plugin. This allows you to create the picture, configure it and then load the picture into the image. When you set background to transparent in a picture with alpha channel, you can preserve the transparency from the SVG. And as you specify a size for the picture and reading it, you can scale the SVG to the size you need:

 

# Load image from container

Set Variable [ $image ; Value: MBS( "GMImage.New"; "500x500"; "transparent" ) ] 

 

# turn on alpha channel and set background to transparent

Set Variable [ $r ; Value: MBS( "GMImage.SetType"; $image; 7 ) ] 

Set Variable [ $r ; Value: MBS( "GMImage.SetBackgroundColor"; $Image; "transparent" ) ] 

 

# Read SVG

Set Variable [ $r ; Value: MBS( "GMImage.ReadFromContainer"; $image; SVG to PNG::InputFile; "500x500"; 0; "SVG" ) ] 

# Output to container and release image

Set Field [ SVG to PNG::OutputFile ; MBS( "GMImage.WriteToPNGContainer"; $image; "test.png") ] 

Set Variable [ $r ; Value: MBS("GMImage.Free"; $image) ] 

If you have questions or need a newer plugin including the new plugin, please don't hesitate to contact us.


MBS Xojo Plugins, version 20.2pr2

New in this prerelease of the 20.2 plugins: Download: monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.

MBS FileMaker Plugin, version 10.2pr2

New in this prerelease of version 10.2 of the MBS FileMaker Plugin: Download at monkeybreadsoftware.com/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder.

MacOS System Preference Links

Since MacOS 10.10 we got links to open system preferences and point user to a specific preference panels.

In general you have "x-apple.systempreferences:" as URL scheme followed by the bundle ID of the preferences panel. Not all preference panes can be accessed this way and some have special parameters for sub panels. Here is the list:
Preference PaneBundle IdentifierCan be opened via URL?
Accountscom.apple.preferences.usersno
Appearancecom.apple.preference.generalno
Bluetoothcom.apple.preferences.Bluetoothno
ClassroomSettingscom.apple.ClassroomSettingsno
DateAndTimecom.apple.preference.datetimeno
DesktopScreenEffectsPrefcom.apple.preference.desktopscreeneffectno
DigiHubDiscscom.apple.preference.digihub.discsno
Displayscom.apple.preference.displaysno
Dockcom.apple.preference.dockno
EnergySavercom.apple.preference.energysaverno
Exposecom.apple.preference.exposeno
Extensionscom.apple.preferences.extensionsno
FibreChannelcom.apple.prefpanel.fibrechannelno
iCloudPrefcom.apple.preferences.icloudyes
Inkcom.apple.preference.inkno
InternetAccountscom.apple.preferences.internetaccountsno
Keyboardcom.apple.preference.keyboardno
Localizationcom.apple.Localizationno
Mousecom.apple.preference.mouseno
Networkcom.apple.preference.networkno
Notificationscom.apple.preference.notificationsyes
ParentalControlscom.apple.preferences.parentalcontrolsno
PrintAndFaxcom.apple.preference.printfaxno
PrintAndScancom.apple.preference.printfaxno
Profilescom.apple.preferences.configurationprofilesno
Securitycom.apple.preference.securityyes
SharingPrefcom.apple.preferences.sharingyes
SoftwareUpdatecom.apple.preferences.softwareupdateyes
Soundcom.apple.preference.soundno
Speechcom.apple.preference.speechyes
Spotlightcom.apple.preference.spotlightno
StartupDiskcom.apple.preference.startupdiskno
TimeMachinecom.apple.prefs.backupno
TouchIDcom.apple.preferences.passwordyes
Trackpadcom.apple.preference.trackpadno
UniversalAccessPrefcom.apple.preference.universalaccessyes
Walletcom.apple.preferences.walletno
(more)

Query FileMaker records as JSON

When you need FileMaker records as JSON, you can just query them via MBS Plugin functions. Use FM.SQL.Execute first to run SQL and get reference number to result in memory. Then call FM.SQL.JSONRecords to get the records as a JSON array. This has high performance and may be faster than looping in a script to build the JSON in pure FileMaker functions.

Once you have the JSON, you may just pass it to FileMaker's data API to move records to another server or pass them as payload for a web service. Within the SQL you can make adjustments to the data. For example you insert fixed values with putting them in the SQL (text in single quotes), you can use CONCAT to concat texts or use CAST() to change data type in SQL. By passing field list to FM.SQL.JSONRecords, you can rename the fields to match whatever you target service expects.

# get related teams
Set Variable [ $r ; Value: MBS( "FM.SQL.Execute"; Get(FileName); "SELECT \"UUID\", \"ID\", \"ID_Abteilung\", \"Team.Name\", \"Txt_Anz.Mia\" FROM \"Teams\" WHERE ID_Abteilung=?"; Abteilung::ID) ]
If [ MBS("IsError") ]
    Show Custom Dialog [ "SQL error" ; $r ]
Else
    # fill as json in field
    Set Field [ Abteilung::JSON_Abteilung ; MBS( "FM.SQL.JSONRecords"; $r; "UUID¶ID¶ID_Abteilung¶Team.Name¶Txt_Anz.Mia") ]
    Set Variable [ $e ; Value: MBS( "FM.SQL.Release"; $r ) ]
End If

Don't forget to release memory when you are done by calling FM.SQL.Release function.
Check also FM.SQL.JSONRecord to just get one row as JSON object. Use FM.SQL.InsertRecords to insert records into another table in another file within FileMaker or FM.SQL.InsertRecordsToSQL to insert records to a foreign database, e.g. MySQL. You can use FM.SQL.CSV to get records as CSV for exporting.

This works in runtime applications and may be useful in all FileMaker apps to collect data to send to a web service, e.g. to FileMaker Server's DATA API.

If you have questions, please don't hesitate to contact us.

Connect Xojo to SAP via RFC

For next MBS Xojo Plugins 20.2, we will have a new set of classes to connect to SAP systems via the SAP NetWeaver RFC SDK 7.50. The SDK allows to call remote functions in the SAP application and move data to/from SAP.

By connecting Xojo applications to SAP, we enable a whole new field of collaboration. Xojo developers can lookup records or call functions to trigger actions in SAP. Developers using SAP on a daily basis can now optionally use Xojo to develop utility applications to help their daily routine. We imaging a lot of import/export applications may be doable as well as interface applications to connect to other devices. e.g. let a Xojo app measure something and send results to the SAP application.

To get the SDK and development access to SAP applications you need to be registered SAP user. The company with the SAP license needs to have user licenses for this usage. And the SDK is available for MacOS, Windows and Linux and so are our plugin classes.

Check the RFCModuleMBS module to load the libraries and check global parameters like the location of the INI file. Then use RFCConnectionMBS class for a connections, query function descriptions and call functions. Use classes for tables and structures to work on records.

Here a screenshot of the sample project we made with a client:



Please let us know if you like to learn more.
SAP and SAP NetWeaver are trademarks from SAP SE.

Virtuelle FileMaker Stammtische

Da aktuell kein Restaurant oder Biergarten offen hat, verlegen sich viele Stammtische ins Internet.

Dienstag war der Virtueller, überregionaler FileMaker Stammtisch vom Holger Darjus organisiert. Immerhin 56 Leute waren zur Spitzenzeit online!

Heute Abend findet dann der Hamburger Stammtisch virtuell statt. 2. April, gegen 19 Uhr per Zoom teilnehmen: Zoom Link.

Voraussichtlich findet der Ulmer Stammtisch die Woche darauf auch virtuell statt.

Der Zürcher Stammtisch findet am 17. April online statt. Anmeldung

Generell bietet es sich an, dass FileMaker Entwickler aus dem ganzen Deutschsprachigen Raum sich regelmäßig treffen. Und reihum können verschiedene Leute die Moderation übernehmen.

MBS Xojo Plugins, version 20.2pr1

New in this prerelease of the 20.2 plugins: Download: monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.

MBS FileMaker Plugin, version 10.2pr1

New in this prerelease of version 10.2 of the MBS FileMaker Plugin: Download at monkeybreadsoftware.com/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder.

Archives

Nov 2024
Oct 2024
Sep 2024
Aug 2024
Jul 2024
Jun 2024
May 2024
Apr 2024
Mar 2024
Feb 2024
Jan 2024
Dec 2023
Nov 2023
Oct 2023
Sep 2023
Aug 2023
Jul 2023
Jun 2023
May 2023
Apr 2023
Mar 2023
Feb 2023
Jan 2023
Dec 2022
Nov 2022
Oct 2022
Sep 2022
Aug 2022
Jul 2022
Jun 2022
May 2022
Apr 2022
Mar 2022
Feb 2022
Jan 2022
Dec 2021
Nov 2021
Oct 2021
Sep 2021
Aug 2021
Jul 2021
Jun 2021
May 2021
Apr 2021
Mar 2021
Feb 2021
Jan 2021
Dec 2020
Nov 2020
Oct 2020
Sep 2020
Aug 2020
Jul 2020
Jun 2020
May 2020
Apr 2020
Mar 2020
Feb 2020
Jan 2020
Dec 2019
Nov 2019
Oct 2019
Sep 2019
Aug 2019
Jul 2019
Jun 2019
May 2019
Apr 2019
Mar 2019
Feb 2019
Jan 2019
Dec 2018
Nov 2018
Oct 2018
Sep 2018
Aug 2018
Jul 2018
Jun 2018
May 2018
Apr 2018
Mar 2018
Feb 2018
Jan 2018
Dec 2017
Nov 2017
Oct 2017
Sep 2017
Aug 2017
Jul 2017
Jun 2017
May 2017
Apr 2017
Mar 2017
Feb 2017
Jan 2017
Dec 2016
Nov 2016
Oct 2016
Sep 2016
Aug 2016
Jul 2016
Jun 2016
May 2016
Apr 2016
Mar 2016
Feb 2016
Jan 2016
Dec 2015
Nov 2015
Oct 2015
Sep 2015
Aug 2015
Jul 2015
Jun 2015
May 2015
Apr 2015
Mar 2015
Feb 2015
Jan 2015
Dec 2014
Nov 2014
Oct 2014
Sep 2014
Aug 2014
Jul 2014
Jun 2014
May 2014
Apr 2014
Mar 2014
Feb 2014
Jan 2014
Dec 2013
Nov 2013
Oct 2013
Sep 2013
Aug 2013
Jul 2013
Jun 2013
May 2013
Apr 2013
Mar 2013
Feb 2013
Jan 2013
Dec 2012
Nov 2012
Oct 2012
Sep 2012
Aug 2012
Jul 2012
Jun 2012
May 2012
Apr 2012
Mar 2012
Feb 2012
Jan 2012
Dec 2011
Nov 2011
Oct 2011
Sep 2011
Aug 2011
Jul 2011
Jun 2011
May 2011
Apr 2011
Mar 2011
Feb 2011
Jan 2011
Dec 2010
Nov 2010
Oct 2010
Sep 2010
Aug 2010
Jul 2010
Jun 2010
May 2010
Apr 2010
Mar 2010
Feb 2010
Jan 2010
Dec 2009
Nov 2009
Oct 2009
Sep 2009
Aug 2009
Jul 2009
Apr 2009
Mar 2009
Feb 2009
Dec 2008
Nov 2008
Oct 2008
Aug 2008
May 2008
Apr 2008
Mar 2008
Feb 2008