bBox 1.04 for FileMaker Now Available


We are pleased to announce the release bBox version 1.04, including improvements to text parsing, XPath and SQLite support, and utility functions for FileMaker Admin API, Data API and OData API.

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.

bBox demo file (included)

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

What’s New in bBox 1.04

Since bBox 1.03 came out, two new functions have been added to this version:

  • bBox_ParsePositionList
  • bBox_FM_API_URL

The bBox_ParsePositionList function creates a field of character-based flags based on the expression used, with a syntax nearly identical to the cut command in the Terminal.

Some examples of input expressions and their results are:

-5,8-10     1111100111
2,4,6,8     01010101
1,3-        101+

The bBox_FM_API_URL is a fairly simple function that calculates the URL needed for three of the APIs supported by FileMaker Server: Admin API, Data API and OData API.

Its prototype function looks like this:

bBox_FM_API_URL( connectionType; hostname {; database; port} )

The connectionType parameter is needed because each API method has its own endpoint, and there are even different endpoints depending on whether using on-premise versions of FileMaker Server or Claris’ FileMaker Cloud hosting.

Accepted values are:

  • “ADMIN” — Admin API (on-prem)
  • “CADMIN” — Admin API (FileMaker Cloud)
  • “DAPI” — Data API (on-prem)
  • “CDAPI” — Data API (FileMaker Cloud)
  • “ODATA” — ODATA API (on-prem)
  • “CODATA” — ODATA API (FileMaker Cloud)

The hostname parameter will be either an IP address (as text), or hostname along the lines of “myserver.mydomain.com”.

The database parameter is required for DAPI and ODATA based protocols, but is not used for the ADMIN API. This value will be URL encoded, so a database name like “My Database” will have the space character encoded for you.

The port parameter will default to 443, as used for most connections, but can be specified if needed.

Other Changes

  • XPath version upgraded to libxml 2.13.2 on macOS (Ubuntu plug-in uses the version installed on OS, currently 2.9.13 for Ubuntu 20 & 22)
  • a race condition was fixed that could occur if there were multiple concurrent calls to SQlite functions
  • bBox_SQLiteExec now accepts multiple statements
  • the fm_csv extension has been added so that bBox_SQLiteExecute can import CSV exports

The fm_csv extension in SQLite is triggered as part of a CREATE VIRTUAL TABLE statement in a bBox_SQLiteExecute call. Unlike how extensions work in the sqlite3 command, no .load statement is required. In the example below, we specify the crlines option to indicate the use of carriage returns as line delimiters (the default for FileMaker exports on macOS & Linux. We then map the virtual table to the contents of a .csv file given in its filename parameter. An embedded CREATE TABLE statement creates the table and columns that the CSV will be mapped to.

bBox_SQLiteExec (
   $ref;
   "CREATE VIRTUAL TABLE temp.examples USING fm_csv(
      crlines,
      filename='/private/tmp/examples.csv',
      schema='CREATE TABLE csv(category TEXT,create_date TEXT,enabled_t INTEGER)');"
)

Known Issues

  • on macOS, if using Python functions except , be sure that Python version 3.11 is installed
  • on Ubuntu Linux, be sure to follow the steps in the README document or the plug-in will not load
  • bBox_MacCalendar’s requestAccess operation does not reliably trigger the macOS System Setting’s access dialog

bBox Documentation

Learn more about how to install and use this plug-in on the bBox Wiki.

Python for FileMaker, using bBox + bzPython

bzPython-FM demonstrates executing Python code directly from FileMaker, in a way that is simple and straightforward to script, utilizing the bBox plugin. The demo file for bzPython shows how a FileMaker Developer can use Python code (writing it yourself, or partnering with another Developer), then pass it to a FileMaker module.


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

Previous Post
OData – Use Cases Compared with FileMaker Data API
Next Post
Make the impossible easy with AI and FileMaker 2024 – Claris Community Live