bBox 1.05 for FileMaker Now Available


We are pleased to announce the release of bBox version 1.05, which adds support for schema change notifications, a new Ubuntu ARM binary, and DuckDB integration.

bBox is a free utility plug-in to extend FileMaker solutions to easily use code libraries. Supporting both macOS & Ubuntu Linux, it has functions to help you work with Python, JavaScript, PHP, Ruby, AppleScript, Bash/Zsh/sh, XPath, and SQLite. Also included is a demo file that has over 220 examples of how you can put bBox functions to work for you.

If you're interested in Python integration with FileMaker, also check out bzPython-FM, which uses bBox.

bBox demo file (included)

The bBox product page includes links to downloads, product info and documentation.

What's New in bBox 1.05

DuckDB

Possibly the biggest change is the replacement of the SQLite functions with DuckDB. Although not 100%, DuckDB offers a great deal of compatibility with SQLite, and can even use its database files. DuckDB improves on SQLite by having support for CSV and Parquet files, ability to access Postgres databases, and performing data analytics. In particular, its column based storage complements FileMakers row based method, allowing DuckDB to do data aggregation functions much more quickly than FileMaker.

Python

On macOS, Python 3.13 is now the default for the bBox_PythonCompile and related functions. For Linux we are still holding back at Python 3.9 (Ubuntu 20) and Python 3.10 (Ubuntu 22) due to those being the versions available in the default Ubuntu package repos. You can still use the bBox_Python3Run function if you need flexibility with the Python installation, but at expense of losing functions like fm.executesql in Python.

ARM on Ubuntu

This will be the first version of bBox to include an ARM binary for Ubuntu. Only Ubuntu 22 is supported, as FileMaker Server is not available for Ubuntu 20 with ARM CPUs.

JQ

For macOS, the JQ JSON processor has been updated to version 1.7.1. One minor problem found in testing: JQ will report its version as just 'jq-' instead of the expected 'jq-1.7.1'. Information on what's changed can be found at https://github.com/jqlang/jq/releases/tag/jq-1.7.1.

On Linux, JQ is by default the version provided by Ubuntu, which is 1.6 for both Ubuntu 20 & 22.

Schema Notifications

With FileMaker Server v21.1 (2024) there is new functionality for plug-ins to receive notifications of changes to database schema, layout, custom functions, or scripts. These come in the form of a JSON payload. As a plug-in, bBox can make use of this notification data.

Here's an example of the messages for a simple script change:

{
  'account' : 'simon',
  'catalog' : 'script',
  'file' : 'bBox Plug-in Demo.fmp12',
  'id' : '165',
  'user' : 'Simon Brown'
}
{
  'account' : 'simon',
  'catalog' : 'script',
  'file' : 'bBox Plug-in Demo.fmp12',
  'id' : '<meta>',
  'user' : 'Simon Brown'
}

In the first message, we get the ID of the script that was changed. That's followed by a subsequent message indicating that the script's meta data has changed, presumably due to the modification count changing.

Schema message handling is configured with a script step that has the following prototype:

bBox Schema Notifications [ Type: (DuckDB, OData, Syslog) PathOrURL: 'POSIX file path or URL' Script Name: 'script name' Credentials: 'user:password' ]

You can get messages sent to you three ways:

  • Syslog
  • DuckDB
  • OData (run a FileMaker script)

Syslog is the default method and the easiest to configure, with the last three parameters of the script step being ignored. It would probably require more work to parse the results however. You'd likely either be using the log (macOS) or journalctl (Ubuntu) commands to query syslog for the messages later.

DuckDB is another option. When this method is first selected you'll normally give it a file path to create the DuckDB database file in, and it will run the following SQL to set up the table:

CREATE TABLE IF NOT EXISTS fm_schema_message (timestamp DATETIME DEFAULT CURRENT_TIMESTAMP, message TEXT);

When needed later, you could use the bBox_DuckDB functions to retrieve the values. However, you could initialize the table prior to the bBox Schema Notifications call to configure the database file to use a .csv file instead of the native DuckDB format. This would allow you to then import the records easily into a FileMaker table.

Last is the OData message notification method. Here you'll specify a URL set to the server and database that will be processing the message data. The receiving server will need to have OData access enabled, and you'll need account info for an account that has the fmodata extended privilege enabled.

Set Variable [ $baseURL ; Value: bBox_FM_API_URL('ODATA'; 'localhost'; 'bBox Plug-In Demo' ) ]
bBox Schema Notifications [ Type: OData ; PathOrURL: $baseURL ; Script Name: 'store_schema_change' ; Credentials: 'myuser:mypass' ]

Above I've used the bBox_FM_API_URL function to help calculate the correct endpoint URL, but that isn't a requirement. OData script requests can't be used with script names that have any special characters, so keep your script handler's name as simple as possible.

Your handler would do something similar to the following to extract the message it was sent:

New Record/Request
Set Field [ SCRATCH::text_1 ; Base64Decode ( Get (ScriptParameter) )

Minimum macOS Version

The oldest version of macOS recommended for using bBox is Monterey (macOS v12.1), with 12.7 being the lowest version tested. Please note that there may be different compatibility requirements for FileMaker Pro and compatibility requirements for FileMaker Server.

Update: December 4, 2024

There were two problems found with the previous build, and version 1.05.1 fixes the following:

  • on macOS, the gm binary for GraphicsMagick was missing
  • DuckDB handler script in the demo file will create a .csv file at /tmp/examples.csv
  • fixed an intermittent crash if bBox_Bash, bBox_Shell, or bBox_Zsh were used server-side on macOS

Want updates on our latest blog posts?
Subscribe to our newsletter!

Previous Post
Beezwax Sponsors EngageU FileMaker Developer Conference
Next Post
Test to Hyve