The last days I chatted with a FileMaker developer who had a need for some XML handling functions. So I added a few functions, first one to extract node names from an XML:
XML.NodeNames. You pass in a XML and it can give you the list of node names in the first layer or if you want recursively all layers.
Next we got a function to get a subtree (
XML.SubTree). So you may have a big XML with a smaller chunks and we can query nodes inside a bigger tree. This includes getting the nth entry like the nth record in a list of records.
The
XML.ExtractText extracts the text inside an XML tree. So all text portions are returned as a list. You can first use the subtree function to get a part of a XML to only get a portion of the texts.
We got a few functions to handle attributes.
XML.GetAttribute returns the value for the attribute.
Setting Variables
Now we got something special for FileMaker Scripts.
We parse an XML with the
XML.SetVariables function, identify all nodes with text values and create variables for you automatically. The plugin sets those variables and returns a list of the names. Later you can pass the list to
XML.ClearVariables to clear them for another run.
For example the script looks like this:
Set Variable [$XMLVariables; Value:MBS( "XML.SetVariables"; test::input; 1)]
Set Variable [$otherVariable; Value:1]
#See Variables in Data Viewer
Set Field [test::output; MBS( "XML.ClearVariables"; $XMLVariables)]
Set Variable [$someVariable; Value:1]
The test XML:
<?xml version="1.0" encoding="UTF-8"?>
<Job>
<Name>Test</Name>
<CreationDate>2016-11-23 12:34:56</CreationDate>
<Reference>8F223E5F-6A57-4ECD-9AB2-0FD0DA3414FF</Reference>
<Priority>5</Priority>
<Comment>Just a test.</Comment>
<Labels>
<Label>green</Label>
<Label>work</Label>
<Label>test</Label>
<Label>important</Label>
</Labels>
</Job>
And in the debugger all the variables may look like this for a test XML:
So you can have an input XML, split the values into variables using our plugin and process them in your script. I hope this is handy for you. What do you think?
Plugin will be available soon. If you like to test today, you can email me.

Nickenich, Germany - (December 12th, 2016) -- MonkeyBread Software today is pleased to announce
MBS FileMaker Plugin 6.5 for Mac OS X, Linux and Windows, the latest update to their product that is easily the most powerful plugin currently available for FileMaker Pro. As the leading database management solution for Windows, Mac, and the web, the FileMaker Pro Integrated Development Environment supports a plugin architecture that can easily extend the feature set of the application. MBS FileMaker Plugin 6.5 has been updated and now includes over 4300 different functions, and the versatile plugin has gained more new functions:
For this release we now include a Linux version. This plugin file can be used with
FileMaker Cloud, or on any FileMaker Server running under 64-bit Linux. Over
2200 functions are instantly available for Linux, others may follow later. Please let us know what features you'd like to see for FileMaker Cloud in the future.
We rewrote our
Audit function. It's now much faster, eliminates duplicate log entries and only records one log entry for a new record to reduce the amount of log records. You should see a big performance gain when using tables with a lot of fields and a FileMaker Server for hosting.
The
menu commands have been reimplemented for Windows. Now we support all the
font styling we had on Mac before. You can now use custom fonts, bold/italic/underline/strikeout styles,
font sizes, colors and a background color. Instead of simple checkmarks, you can use bullet, diamond or mixed marks.
For macOS 10.12 we added several
TouchBar functions. You can define one
app wide and per
window touch bars. Each can have buttons which trigger scripts or evaluate expressions. This way you can offer contextual commands on the keyboard and react in FileMaker. You can even define buttons to use in FileMaker itself, like a button to show/hide the debugger.
To interface existing
Java classes, the plugin can now optionally talk to
Java. From older
Java 6 to latest
Java version 8, you can load whatever
Java version you like. Than you can create objects from classes and call both class and object methods. You can set and query properties on those classes or objects and exchange data directly. Containers can be passed/returned to/from
Java as byte arrays for efficient data exchange.
For those using flatbed/feeder scanners, we can now interface them on Windows via native drivers. We use the official
WIA interface from Microsoft which most scanners nowadays support. You can either use
system dialogs to scan or send scan commands directly. On Mac we now provide optionally windows to select scanner or perform scans. In total, we now provide three ways to scan: 1st
TWAIN for macOS and Windows, 2nd
ImageCapture for macOS and 3rd
WIA for Windows. All three ways can get your scans with or without a
dialog to an image file.
For the Script Workspace we provide an enhanced contextual
menu. We provide copy/cut/paste/delete commands at your finger tips and commands to enable/disable script steps. For perform script steps we now provide a way to jump directly to the target script.
On Windows you can now control the print
dialog. Our plugin can automatically select
printer, paper format, paper tray and other options. You can query available printers, paper formats and trays. For Mac, please use our existing PrinterDialog functions.
We added more
DynaPDF functions: You can now directly draw styled text from a field in your layout to a PDF. The plugin internally converts the styles to
DynaPDF formatting commands. You can now
process data from XFA forms automatically and when printing PDFs on Windows, you can now optionally show a print
dialog.
On Mac you can workaround the printing issues with FileMaker and macOS Sierra. If you don't like the scrolling elasticity in your layouts, you can disable it. The plugin can now list and trigger commands on the FileMaker windows directly. For example in a table view, we can trigger the
dialog to customize which fields are shown. Via plugin functions you can control the
updater in FileMaker, trigger update search or change various options.
For editing Excel documents, you can copy sheet content from one sheet to another, even across books. You can copy rows from one sheet to another. When writing formulas you can now include the pre-calculated result as number, text or boolean value.
You can now calculate the width of a text with a given
font. So you can automatically cut text and add dots via custom functions in your layouts.
For Windows we added still photo capture to our video recorder. For the Webviewer you can now switch it to silent mode and
javascript errors are not longer displayed to users.
Our
barcode generator learnt two new types: DotCode and HanXin. You can query the memory used by FileMaker, clear recent
files in
preferences on Mac, list mounted volumes, change orientation for images in EXIF metadata, send text attachments in emails and get/set the current working directory.
We updated
CURL library to version 7.51.0,
DynaPDF to 4.0.5.15, libSSH2 to 1.8, libXL to 3.7.0, OpenSSL to 1.0.2j, SQLAPI++ to 4.1.10, SQLite to 3.15.0 and zint to 2.5.
More details in the
release notes. Please take the time to check our 450 example databases and check where you can use our plugin features in your solutions.

Current MBS FileMaker Plugin in version 6.4/5 support all FileMaker versions from 8.5 to 15. That is ten years!
Our plugin uses the FileMaker 7 plugin format. So until FileMaker 6 the way of writing plugins was different and changed for version 7. When I started writing a FileMaker plugin, the version 8 was current and so I started there and quickly made sure my plugin works on 7 and 8. Over the years we continue with the same interface to FileMaker. All newer functions are weak linked, so our plugin loads in older versions.
For Mac you can use FileMaker 8.5 (Released 2006) to current one. That is due to the switch to Intel CPUs by Apple in 2006 and 8.5 was the first version to support x86 CPUs. We later dropped PPC support and you still can get a copy of our plugin in version 2.4 for PPC support. Current plugin requires Mac OS X 10.6 and newer.
With Windows you can even go back to FileMaker 7 if you like, 12 years back! Current plugin works fine there as well as with newer versions of FileMaker. The picture above shows FileMaker 8 on Windows 10 (Server 2016) with current MBS Plugin from earlier today. We support Windows XP and newer.
If you are lucky to be a member of FileMaker's beta testing, you an even try our plugin with the next FileMaker version and find some new features.
Finally please keep your plugin installation up to date to benefit from bug fixes and improved features. Don't waste hours figuring out details about a bug in an ancient plugin version, which has been fixed last year.
This little function can be called anywhere to optimize a PDF. Of course you should initialize DynaPDF in startup script of your solution. But than you can call OptimizePDF function everywhere and pass in a PDF container value. The PDF is optimized and returned.
If you like add further parameters to decide what optimization to do. The example be low uses a good default setting to reduce PDFs for email delivery.
# Custom Function OptimizePDF(InputPDF)
#
# Optimizes PDF and returns either new one or old one in case of error.
Let ([
PDF = MBS("DynaPDF.New");
OpenResult = MBS("DynaPDF.OpenPDFFromContainer"; PDF; InputPDF);
OpenError = MBS("IsError");
ImportResult = MBS("DynaPDF.ImportPDFFile"; PDF);
ImportError = MBS("IsError");
Options = "FlattenLayers DeleteInvPaths ScaleImages NewLinkNames DeletePrivateData IgnoreZeroLineWidth DeleteAlternateImages DeleteThumbnails";
OptimizeResult = MBS("DynaPDF.Optimize"; PDF; Options; 50; 50; 50; 150; 150; 150; "JPEG"; "JPEG"; "JPEG");
OptimizeError = MBS("IsError");
OutputPDF = MBS("DynaPDF.Save"; PDF; GetAsText(InputPDF));
SaveError = MBS("IsError");
ReleaseError = MBS("DynaPDF.Release"; PDF);
Result = If(
// all okay?
OpenError = 0 and ImportError = 0 and OptimizeError = 0 and SaveError = 0 and MBS( "Container.GetSize"; OutputPDF; "PDF " ) > 0;
// than return new PDF
OutputPDF;
// return old PDF
InputPDF)
];
result )