Upgrading our HTMLViewer functions for Internet Explorer

When you look with auto complete at the methods for HTMLViewer, you see a lot of MBS functions there with IE prefix. We'll cleanup the mess and deprecate all the IE methods we have for HTMLViewer control currently. Instead of we add five new classes and provide the methods there:

IEWindowMBS
IEWebBrowserMBS
IENavigatorMBS
IEHistoryMBS
IEDocumentMBS

All new functions now handle errors by raising IEExceptionMBS exceptions with error number and message set. We added over 50 new methods there to control HTMLViewer on Windows even more. Please let us know if you miss something.

An advantage of the new classes is that you can keep a reference to them in a property. Instead of us looking up the objects internally always, caching them will improve performance.

See also WKWebViewMBS, WebViewMBS, ChromiumBrowserMBS and LinuxWebViewMBS classes for other platforms. You may see the pattern, but instead of putting all methods directly on the HTMLViewer, we plan to move them all into classes and just give you a convenience method to get the instance for the given class.

SerialPort functions in MBS Plugin

Have you tried the SerialPort functions in MBS FileMaker Plugin?

With 39 functions in MBS Plugin related to serial ports, you can:
  • Use serial ports on MacOS and Windows
  • List real ports, virtual ports and those provided via USB adapters
  • Connect to serial port
  • Configure baud rate, parity, data and stop bits.
  • Set CTS, DSR, DTR, RTS, XON flags
  • Send text in any encoding, raw bytes as hex string or individual bytes.
  • Get a script triggered for new data coming in
  • Read data as text in any encoding, raw bytes as hex or single bytes.
  • Read text till new line
  • Suspend and Resume the port
  • Check for available bytes in incoming buffer
  • Clear buffers
You can either work with tight loops to make script pauses till data is arriving or work completely asynchronously with script triggers to handle events when they occur. Great for barcode scanners, scales and various measurement devices. All working from older FileMaker 7 up to latest FileMaker 18.

If you order a MBS FileMaker Plugin license for SerialPort functions, you get over 6000 other functions for free within the same package.

Can FileMaker connect to a Microsoft Access database?

Of course FileMaker can open an Microsoft Access database with help of MBS FileMaker Plugin. You can open an access database via SQL functions and run queries, execute SQL commands and copy data from/to the database.

e.g. connect to a Microsoft Access Database via ODBC:

MBS("SQL.Connect"; $Connection; "Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=C:\mydatabase.accdb;"; $name; $pass; "ODBC")

So pass to SQL.Connect a connection string including file Path and driver name. Optionally add user name and password as parameters. Be sure the installed Microsoft Access Driver has some 32 or 64 bit number as the FileMaker application.

Then use SQL.NewCommand and SQL.Execute functions to run SQL commands. Once you have some data queried from Access, you can easily have the plugin insert the data into a FileMaker table with SQL.InsertRecords or SQL.InsertOrUpdateRecords functions. Other way around you can do a SQL query in FileMaker with FM.SQL.Execute function and copy data with FM.SQL.InsertRecordsToSQL to the foreign database.

Three days till year's end

The year 2019 will end in around three days. Do you need some more licenses?
  • Last chance to update licenses purchased in 2017.
  • You can order licenses for 2020 or later and have delivery plus payment done in 2019.
  • And of course you can order updates for several years in advance for all your MBS products.
  • As all Xojo plugin, LibXL and DynaPDF licenses are per developer, you should check if you got a new developer in your team this year and adjust licenses to match team size.
  • For FileMaker please check if you have enough license for the number of seats or servers you have in use.
Especially if you run on a budget and you want to spend some money in 2019, you can buy updates for several years in advance.

Position and resize FileMaker's dialogs

For next MBS FileMaker Plugin we have a new feature for you: Window.PositionNextDialog function.

You can call this function in a script just before FileMaker shows a dialog. The plugin will watch for new dialogs to show up and the next dialog to come is adjusted. We check if you provided a new X/Y coordinate and if so move the dialog. If you got us a new width and height, we resize the dialog. And if you set the center flag, we finally center the window on screen.

Works fine on MacOS and Windows so far in various FileMaker versions. We hope the function will help people with multiple screens to position the dialogs better.

Coming with next prerelease. Please do not hesitate to contact us questions.

PS: We added already the option to pass 2 for center parameter to center in front of FileMaker window.

Xojo Plugins for EyeOne Devices

The print industry needs to have accurate colors and X-Rite Inc. has a few solutions in that direction. Those include various EyeOne devices to measure colors, quality control applications like ColorCert to make sure the color printed is the one specified and a cloud offering PantoneLIVE to make sure everyone uses the same color standards.

Xojo is a great development tool for cross platform applications for MacOS, Windows and Linux. A few Xojo developers write software to help them work with colors in various ways. This includes software to connect to EyeOne devices and measure colors. If you like to write such a software you need to get a SDK license from X-Rite, download the SDK and then ask us for the matching Xojo Plugin. Over the years we provided several plugins for the various SDKs from X-Rite to interface devices right from the Xojo: i1Pro3, I1IO3, i1iSis, i1Pro and i1iO.

You may also want to look in our LCMS Plugin classes to convert colors from one color space to another and the DynaPDF plugin to put your colors into the PDF files you pass to printers.

See also: Colorspaces in Xojo and Colorspaces in MacOS with Xojo

Windows Media Foundation Player for FileMaker

Until today you could only play video in FileMaker using an interactive container or loading the video in a web viewer. Now you get a new way using our brand new WMFP functions. The MBS Plugin loads a video, creates a video view and places it on top of the FileMaker layout. The video plays independent of FileMaker.

Background Audio

The new functions give you some interesting options. For example you can play audio without user interface in the background. Just by initializing the player without a reference to a window with WMFP.Create. FileMaker users can switch to other layouts, use dialogs and use FileMaker without disturbing the audio. You can control volume, balance and playback rate via script. If the playback reaches the end, we can trigger a script, so you can load another player to play the next song (see WMFP.SetPlaybackEndedScriptTrigger).

Video view on Layout

You can put a rectangle on the layout and tell the plugin to place the video there. The plugin puts the control on top of the FileMaker layout area. By using an existing control on the user interface, you control the position and size of the video area. In a script for resizing the layout you can adjust the video size using WMFP.SetFrame function.

If you use cards, registers or switch layouts, you may want to use WMFP.SetVisible to show/hide the video when needed.

Control functions

A video is loaded asynchronously. With WMFP.GetState you can query whether video is loaded, paused, playing or stopped. To change you can just call WMFP.Play to start playback and pause later if needed (WMFP.Pause).

You can change playback rate with WMFP.SetRate to play half speed or double speed. With balance control (WMFP.SetBalance) you can direct all sound to left or right speaker only. The WMFP.SetMute function can mute the sound.

If the video gets a letter box, you can set the background color with WMFP.SetBorder function.

Usage

When you use the functions, you need to have files on disk, so you need to export them from a container first. Then pass file URL for the file to the WMFP.Create function, if needed by converting path using Path.FilePathToFileURL function.

As video plays independent of what FileMaker does, you can of course just run a video while FileMaker runs a script to do some work. Instead of just waiting 30 seconds to sort records, you can show a video with a nice animation about sorting.

Coming soon with next prerelease.

PS: For Xojo developers, we have the same here: MFPMediaPlayerMBS

Merry Christmas

Frohe Weihnachten und ein gutes neues Jahr!

Merry Christmas & Happy New Year

Joyeux Noël et Bonne Année

Buon Natale e Felice Anno Nuovo


Franziska, Sebastian, Michael, Monika & Christian Schmitz

ChartDirector with Korean alphabet

One of our users asked whether ChartDirector can do text in Korean alphabet (Hangul). As the ChartDirector and MBS Xojo Plugins support unicode, we can answer this with a yes:



The rendering between Mac (left) and Windows (right) looks a little bit different due to different as the fonts are not identically and the platform depended parts of the drawing are not the same. But in order to use all unicode characters, please use a font containing the characters you need.

#If TargetWin32
  Call c.setLabelStyle "ArialUni.ttf"
#Else
  Call c.setLabelStyle "Arial Unicode.ttf"
#EndIf

As you see we specify here the font for the labels to be Arial Unicode as this font contains Korean characters. If you miss to specify the font, you get a default font, which may not contain the characters. The example will be included in future MBS Plugin releases. It also works with other asian characters including Chinese, Japanese and Thai.
If you have questions, please don't hesitate to contact us.

Zooming video containers on Windows

Have you inserted a video into an interactive container field on Windows and when playing the video looks like this?



Give the container field on the layout a name, e.g. MovieField. Now when you use WebView.GetHTMLText in the data viewer, you can get the HTML FileMaker generated to show the video. With a few JavaScript commands, we can adjust the video there:

MBS( "WebView.RunJavaScript"; "MovieField";
    "document.getElementById('Player').uiMode='none';
    document.body.style.transform='';
    document.getElementById('Player').stretchToFit=true; "
) (more)

MBS Xojo Plugins, version 19.6pr4

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

MBS FileMaker Plugin, version 9.6pr4

New in this prerelease of version 9.6 of the MBS FileMaker Plugin:
  • Updated DynaPDF to version 4.0.36.99.
  • Fixed some issues with barcode functions to better handle desired width and height
  • Added JS.SetGlobalPropertyValue and JS.GetGlobalPropertyValue functions.
  • Updated zint library to version 2.7.
  • Fixed a bug with Encryption.Cipher function when key contained char(10).
  • Improved syntax coloring to avoid crash when refreshing while text is being edited.
  • Fixed Webview functions, broken in pr3.
Download at monkeybreadsoftware.de/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder.

Using pinned certificates with our CURL plugin functions

To increase the security of the TLS connections you make with our CURL plugin functions, you can pin the certificate. That means you store a hash of the public key in the certificate and CURL checks this hash against the public key sent from the server. If the hash does not match, the connection is closed and you get back error code 90 with message "SSL: public key does not match pinned public key!".

If you like to see the certificate, you can use set cert info option to true. The plugin collects the certificate information and you can later query it. Use CURL.SetOptionCertInfo and CURL.GetCertInfo functions in MBS FileMaker Plugin for this. In our MBS Xojo CURL Plugin, please use OptionCertInfo property and GetInfoCertInfo method. The information includes the parsed certificate details as well as the PEM style certificate data.

Now in order to use pined certificate, you need the hash, but how to get it?
You could use the openssl command line instructions from the CURLOPT_PINNEDPUBLICKEY documentation page. But there is an easier way. Just put in a hash like "sha256//xxx" with OptionPinnedPublicKey in the plugin. Do your request and in the debug log you find a message like this:

public key hash: sha256//dhF0fnWyRh66b9UWMzm1TdEREOw4vkMunNGZQo0VZSE=
SSL: public key does not match pinned public key!

And now you can simply copy this hash and pass it to the option for the next connection. Don't forget the "sha256//" prefix. Once the hash matches the connection will continue.

Your code can check for the result of the CURL and inform the user if the public key changed. Now it may be good to compare the cert info output to the last one you may have saved and see if they website just renewed their certificate or whether someone tries to hack you and use a fake certificate. If the certificate was renewed with the same private key, the public key won't change.

Don't forget to use a list of acceptable root certificates and let CURL verify the certificates, too. See CAPath option and get cacert.pem from curl website.

Train machine learning models on device

For next MBS FileMaker Plugin we add a new CoreML functions to update the model on device. If you have an updatable model for CoreML, the Apple framework to use machine learning on Mac and iOS devices (including iPad), then you can now use our CoreML.Update function to pass new training data to the plugin and we update the model.

You can load a model with CoreML.OpenModel and you get the description with CoreML.Description, you now see there a new entry trainingInputDescriptionsByName in the JSON. e.g.

  "trainingInputDescriptionsByName" : {
    "drawing" : {
      "optional" : false,
      "type" : "Image",
      "imageConstraint" : {
        "pixelsWide" : 28,
        "pixelFormatTypeName" : "OneComponent8",
        "pixelFormatType" : 1278226488,
        "pixelFormatTypeDescription" : "8 bit one component, black is zero",
        "pixelsHigh" : 28
      },
      "name" : "drawing"
    },
    "label" : {
      "optional" : false,
      "type" : "String",
      "name" : "label"
    }
  }

This shows you there is a drawing parameter for the picture with 28 by 28 pixel resolution in grayscale. The other parameter is the label with the correct output for this image. In a sample call to CoreML.Update we pass input and output paths for the model files and pass the training data as JSON:

MBS( "CoreML.Update";
    "/Users/cs/Desktop/UpdatableDrawingClassifier.mlmodelc";
    "/Users/cs/Desktop/UpdatableDrawingClassifier2.mlmodelc";
    "[{\"drawing\": \"/Users/cs/Desktop/mbslogo.png\", \"label\": \"MBS\"}]" )

In the JSON we expect an array of objects. Each object contains the pairs of input and output parameters. Values are passed as numbers, text or objects. For images we decided to allow you to pass the image file as native file path and then the plugin adjust images as needed.

You can build solutions which come with a pre-calculated machine learning model, which is then adjusted on device (e.g. iPad) while the user takes new data and provides correct answers. On the server you can take a basic model to recognize some data and then adjust with all the records you have in your database.

If you are interested to use this functions, please try the 9.6pr3 release or newer. This functionality is available on MacOS 10.15 or iOS 13. Calculation happens on device using GPU if available.

See also Presentation about a Core ML database for image detection.

Update Machine Learning Model on Device

For next MBS Xojo Mac64bit Plugin we add a CoreML functions to update the model on device. If you have an updatable model for CoreML, the Apple framework to use machine learning on MacOS, then you can now use our MLUpdateTaskMBS class to pass new training data to the plugin and we update the model.

You can load a model with modelWithContentsOfFile function in MLModelMBS class and you get the description with modelDescription function, you now see there a new property called trainingInputDescriptionsByName with a dictionary containing all the keys describing input parameters.

For our example model we pass a drawing parameter for the picture with 28 by 28 pixel resolution in grayscale. The other parameter is the label with the correct output for this image. We fill those parameters with the matching MLFeatureValueMBS values into a dictionary. The dictionary is then passed to a new MLDictionaryFeatureProviderMBS object.

Once you have all MLDictionaryFeatureProviderMBS objects for your training, you pass them all into a MLArrayBatchProviderMBS object. With an object from MLModelConfigurationMBS class we define whether GPU is used. Finally we pass the training data with input file to the MLUpdateTaskMBS class to run the training. We use a subclassed MLUpdateProgressHandlersMBS to catch the Progress and Completed events. And in the complete event, we can get the new model from the MLUpdateContextMBS object and write it to the new model file.

You can build solutions which come with a pre-calculated machine learning model, which is then adjusted on device (e.g. MacBook) while the user takes new data and provides correct answers. On the computer back in the office you can take a basic model to recognize some data and then adjust with all the records you have in your database.

If you are interested to use this functions, please try the 19.6pr3 release or newer. This functionality is available on MacOS 10.15 or iOS 13. Calculation happens on device using GPU if available.

MBS FileMaker Plugin, version 9.6pr3

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

MBS Xojo Plugins, version 19.6pr3

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

Generate sort script automatically

Recently we had the issue that we would like to allow users to sort data in FileMaker without using the sort dialog. In the user interface we have buttons to click for the user to sort table by one of the fields. You can think about a button bar with the field names where it makes sense to sort by.

The button calls a script and passes the field name as parameter. As FileMaker doesn't allow you to script the sort command manually, we need to generate a script with a lot of combinations. Today we want to show you a sample database for generating sort scripts automatically.
(more)

Fetch 5.8 released

For the last 20 years I have been a frequent user of the little file transfer application called Fetch from Fetch Softworks.

My first order for a license is from 2001. Later one in 2009 and as a gratitude I just ordered new licenses for the company. Continued development should be honored, even if developers don't force you to pay.

With the new version 5.8 they moved to a 64-bit architecture for compatibility with macOS 10.15 Catalina and added support for Dark Mode on macOS 10.14 Mojave and later. More in the release notes here.

This is great news as this is one of the applications we waited for to support 64-bit before using macOS Catalina (next year).

PS: I also use transmit sometimes, another great app where I also have a license.

New example database PDF library

For years we told clients that DynaPDF can render preview images, extract text, search and highlight within a page. Now we show you in one example all those together:


Watch on Youtube

We import using our FileDialog functions to select multiple documents. With DynaPDF functions we read metadata, create a first page preview picture and extract the text for the whole document. Now we can search to find the document we need. But when we also split the documents and store each page in a record, we can later find exactly the pages matching the search string. And for the preview picture we dynamically create a picture with highlighting the search term.

Maybe this is interesting for your solution?

Xojo 2019 Release 3 Now Available

Xojo 2019 Release 3 is now available with over 100 changes and improvements, focusing on iOS.

This release includes the following iOS features:
  • iOS 13 Dark Mode support
  • Color Groups for easy Dark/Light Mode drawing
  • iOSRectangle now supports Blur effects
  • Access to the over 1,500 button icons included in iOS 13
  • iOS Text Area border settings
In addition, this release includes:
  • SQLite has been updated to 3.29.0
  • ListBox iterators
  • String improvements
  • DateTime improvements
  • System.VersionData class for getting OS version information
The complete list of improvements in Xojo 2019 Release 3 can be found in the release notes. Download now!

Xojo Meeting in Netherlands

As I am traveling again to the Netherlands, I like to arrange a Xojo developer meeting.

Let's talk about Xojo, conferences, plugins and other programming topics.

Please help to decide on the extract day: Xojo Survey: Wednesday 8th January

We can reserve a table in a nice restaurant in Rotterdam near the main train station and talk an evening about Xojo. Time probably around 18 to 22 o'clock, so you can come later or leave early.

Interested people can of course make an extra appointment with me for private consulting.

PS: Looks like it will be Wednesday. We'll look for a meeting place!

FileMaker Meeting in Netherlands

As I am traveling again to the Netherlands, I like to arrange a FileMaker developer meeting.

Let's talk about FileMaker, conferences, plugins and other programming topics.

Please help to decide on the extract day: FileMaker Survey: Wednesday 8th January

We can reserve a table in a nice restaurant in Rotterdam near the main train station and talk an evening about FileMaker. Time probably around 18 to 22 o'clock, so you can come later or leave early.

Interested people can of course make an extra appointment with me for private consulting.

PS: Looks like it will be Wednesday. We'll look for a meeting place!

MBS Xojo Plugins, version 19.6pr2

New in this prerelease of the 19.6 plugins:
  • Added JavaScriptEngineMBS class with DukTape JavaScript engine.
  • Added ColWidthPx and RowHeightPx to XLSheetMBS class.
  • Rewrote CURL data receiving to improve performance for POP3 and IMAP.
  • Changed default text encoding for CURL.SetInputText and CURL.AddInputText to UTF-8.
  • Changed OptionPostFields in CURLSMBS to free previous data directly instead of waiting for destructor.
  • Added LGLMBS class with SAT Solver.
  • Updated LibXL to version 3.8.8.
  • Changed SmartCardMBS.SplitValues method to mark valid UTF-8 strings to have UTF-8 encoding.
  • Disabled scale for DynaPDF graphics support as it doesn't work and may let content disappear.
Download: monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.

MBS FileMaker Plugin, version 9.6pr2

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

Three weeks till year's end

The year 2019 will end in less than three weeks. Do you need some more licenses?
  • You can order licenses for 2020 or later and have invoice, delivery and payment done in 2019.
    This way you secure the current pricing and the possibility to keep upgradeability for older licenses.
  • And of course you can order updates for several years in advance for all your MBS products.
  • As all our Xojo and DynaPDF plugin licenses are per developer, you should check if you got a new developer in your team this year and adjust licenses to match team size.
  • For MBS FileMaker Plugin please check if you have enough license for the number of seats or servers you have in use.
    If you upgrade to unlimited seats or servers, the plugin won't need to check the usage counts.
Especially if you run on a budget and you want to spend some money in the old year, you can buy updates for several years in advance.
If you need help to decide what Xojo, FileMaker or plugin license you need, we may be able to assist you.

Our JavaScript engine for FileMaker

For next MBS FileMaker Plugin we add a JavaScript engine to be used within your FileMaker solution without a web viewer control. You can execute JavaScript and offer it to your users as a scripting language within your solution. If you need, you can run JavaScript snippets at runtime to do calculations and even integrate your own functions to call back to FileMaker scripts.

 

Evaluate JavaScript

 

You can use JS functions in next plugin version and instantiate a JavaScript environment. Then you can evaluate some JavaScript code and get back a result. For your convenience we convert JavaScript data types to JSON.

 

Set Variable [ $js ; Value: MBS( "JS.New" ) ] 

Set Variable [ $r ; Value: MBS( "JS.Evaluate"; $js; "4+5") ] 

Show Custom Dialog [ "Result" ; $r ] 

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

 

Alternative you can use JS.EvaluateToString function which converts the result to text. If something goes wrong you may get an error message, so it may be good to check for an error with our IsError function.

 

(more)

Our JavaScript engine for Xojo

For next MBS Xojo Plugins we add a JavaScript engine to be used within your Xojo application without a HTMLViewer control. You can execute JavaScript similar to the XojoScript control and offer it to your users as a scripting language within your solution. If you need, you can run JavaScript snippets at runtime to do calculations and even integrate your own functions to call back to Xojo.

 

Evaluate JavaScript

 

You can use JavaScriptEngineMBS class in next plugin version and instantiate a JavaScript environment. Then you can evaluate some JavaScript code and get back a result. For your convenience we convert between JavaScript data types and Xojo's variant data type.

 

Dim j As New JavaScriptEngineMBS

Dim v As Variant = j.Evaluate("2+3")

MsgBox v.StringValue

 

The variant will now contain the number 5. Alternative you can use EvaluateToString which converts result to string. If something goes wrong you may get a JavaScriptEngineExceptionMBS exception raised, so it may be good to wrap it in a try & catch block.

 

For your convenience we define a Print, Input and Yield function in JavaScript. The print command will raise the Print event and allow you to implement a print command for JavaScript to write to a log window. The Input event works similar, but passes back the result from Xojo back to JavaScript and converts the types back. Third function for yield is to give time to other Xojo threads if a you run JavaScript in a thread.

 

(more)

TraceFile option in MBS Xojo DynaPDF Plugin

If you are looking to debug a problem with your Xojo code using MBS Xojo DynaPDF Plugin, we can help with our trace feature.

Dim pdf As New MyDynapdfMBS
pdf.TraceFile = SpecialFolder.Desktop.Child("dynapdf.txt")

Once you put the TraceFile assignment there, the plugin will open the file and start writing log messages until the PDF is object is done. The output may look like this:

SetLicenseKey
CreateNewPDFWfile
    file: /Users/cs/Desktop/Create PDF.pdf
    Result: true
SetDocInfoW
    DInfo: 4
    Text: "My first Xojo output"
    Result: true
SetPageCoords
    value: 1
    Result: true
Append
ClearPageGraphics
    Result: true
SetFontW
    Name: "Times"
    Style: 1
    Size: 40.000000
    Embed: true
    CP: 39
    Result: 0
WriteFTextW
    Align: 1
    Text: "My first Xojo output!"
    Result: true
EndPage
ClearPageGraphics
    Result: true
CloseFile
ClearPageGraphics
MyInitProgressProc
    ProgType: 1
    MaxCount: 1
MyProgressProc
    ActivePage: 1
    Result: 0
MyProgressProc
    ActivePage: 1
    Result: 0
    Result: true
PDFDestructor

Now you see more than you may be calling directly. You see the file path used for creating the PDF with CreateNewPDF function. Then we call SetDocInfo to set the subject field for the PDF. We set page coordinate system and append a page, which implicitly clears page graphics. Next we set a font and write something and you see all the details like the code page 39, which is unicode. We close the page, which clears page graphics again in case you used it. We close the file and save it, which invokes optionally the progress events until the destructor runs finally and ends the trace file.

If you build a complex PDF and you call thousands of DynaPDF functions, this log may help you to find the errors by looking for error messages or result codes here.

Formatting and error checking expressions in FileMaker

You may be designing databases, which store FileMaker calculations in fields to evaluate them later. This may be to feed the MBS FileMaker Plugin functions like HotKey.SetEvaluate, MenuItem.SetEvaluate, SyntaxColoring.AddContextMenuCommand or one of the many others which take an expression to evaluate in case something happens.

Format

Now if your database runs on a Mac and MBS FileMaker Plugin is installed, you can use the syntax coloring of our plugin to format the formula, e.g. like this script:

If [ MBS( "IsMacOS" ) = 1 ]
    Set Variable [ $r ; Value: MBS( "SyntaxColoring.Format"; EvaluateTest::Expression; 0 ) ]
    Set Field [ EvaluateTest::Expression ; $r ]
End If

The check For MacOS is to make sure we call it on MacOS and to check if the plugin is installed at all. If the plugin is missing, this will fail as a condition and then the format function is not called. The SyntaxColoring.Format function uses the syntax coloring definitions the plugin uses for formatting the expressions in the calculation dialog and you can change those. See fmSyntaxColorizer or other databases which provide an interface on the MBS Plugin function SyntaxColoring.AddTag to register those rules.

Check Error

To check for errors you may want to use EvaluationError on the result of Evaluate function. But in the expression you may want to have a Let wrapped in an If(false; ...) expression. The If makes sure the code will go through the parser for the syntax check, but not actually run. The Let with the expression makes sure we wrap your expression properly and you don't mess with the If. In case there are comments in the expression, the ¶ will block any // comment causing an error.

Here we test the If/Let evaluate combination:


Finally we put all in a script to run when expression field is saved and we put the error number into a field in our script:

Set Error Capture [ On ]
Set Variable [ $expression ; Value: "If(false; Let(r=" & EvaluateTest::Expression & "¶;0))" ]
Set Variable [ $e ; Value: EvaluationError(Evaluate($expression)) ]

Set Field [ EvaluateTest::Error ; $e ]

To get a list of the error codes possible, please check the list in the documentation in the 1200 to 1225 range.

Heise Mac Dev

Today at the Heise MacDev, a Mac & iOS developer conference organized by Heise publisher.



In the last ten years I visited Macoun a couple of times. Now we may end up having two conferences in Germany for Mac & iOS developers. Let's learn new techniques, meet local developers and get new contacts.

ImageMagick 7 for Xojo

In the last weeks we worked on a bigger project for our Xojo plugins. As you may know we support both GraphicsMagick and ImageMagick libraries in our plugin. For GraphicsMagick we build the library and embed it in our plugins. For ImageMagick we do not embed the library, so you need to bring your own library file. In our Xojo plugins we used to be based on version 6.9 of ImageMagick and we have three configurations: 8, 16 and 32 bit depth. We have each class for ImageMagick three times and by using one of the classes, you pick the depth you want, e.g. IMImageQ16MBS class for 16 bit. Then you need to load at runtime in your application the right library (DLL/dylib/so) and the classes can work.

For Image Magic 7 the API changes significantly. Half of the plugin code needed an update or rewrite. As we had to rewrite, we took a bigger approach. We created a new set of classes, all with 7 in the name. As ImageMagick now supports High Dynamic Range Images in the HDRI versions of the library, we got 7 combinations of 8, 16, 32, 64 bit with and without HDRI (There is no 64bit without HDRI). For a time we had all classes compiled in 7 versions, but this was not the designed we liked. How would it be to have one class which adapts?

After a few changes to the plugin code we got exactly this. You load the library and we run a few functions to ask the library whether it supports HDRI and what the desired depth is. In our functions to fill an image with a Xojo picture, we now branch out to the right code to convert a pixel from 8 bit in Xojo per channel into the desired bit depth. Yes, we have 7 functions in C code for this and use the right one.

You can simply download the current ImageMagick libraries from the website, e.g. ImageMagick-x86_64-apple-darwin19.0.0.tar.gz for MacOS or ImageMagick-7.0.9-7-Q16-HDRI-x64-dll.exe for Windows 64-bit. On Windows with installer just install it and the path environment variable points to the right folder, so you can just load the DLL by name. For MacOS, please point to the right dylib file. This works fine for us with 16 bit color depth on Mac and 16 bit HDRI on Windows.

Please try the new ImageMagick7 classes. ImageMagick is a huge library. We have already over 200 methods there to edit images with a lot of effects. But we are not yet done. But if you see a method you miss, please contact us.

Signature Field in FileMaker

Recently a customer asked for a signature field in FileMaker. As usual we replied with a note that this can be done with web viewer and a HTML 5 canvas control doing drawing. Then capture content with JavaScript and pass to FileMaker. The MBS FileMaker Plugin may help with WebView.RunJavaScript function. To transfer bigger blocks of text WebView.SetFormTextAreaValue and WebView.GetFormTextAreaValue can help with a hidden text area control. See video:



The script to save is quite easy as it just asks canvas to save its content as base64 encoded png image into the hidden text area. Then uses WebView.GetFormTextAreaValue to query this value, cuts out the header and decodes the base64 image:

Set Variable [ $r ; Value: MBS( "WebView.RunJavaScript" ; "web"; "formtest.output.value = document.getElementsByTagName('canvas')[0].toDataURL('image/png');" ) ]
Set Variable [ $dataURL ; Value: MBS( "WebView.GetFormTextAreaValue" ; "web"; "formtest"; "output"; 0 ) ]
Set Variable [ $p ; Value: Position($DataURL; ","; 1; 1) ]

If [ $p > 0 ]
    Set Variable [ $data ; Value: Middle($dataURL; $p + 1; Length($dataURL)) ]
    Set Field [ Signature Field::Data ; Base64Decode ( $data; "signature.png" ) ]
End If

We hope you like this example: SignatureField.zip. We'll include it in future plugin releases as an example.

Black Friday and Cyber Monday sale

Our Black Friday & Cyber Monday sale continues till Tuesday evening:

First use coupon code BlackFridayMBS for our web shop to order new licenses with a 20% discount. Works for both FileMaker and Xojo plugin licenses.

If you have special needs, you can email us to get an invoice or Paypal payment link directly. We know some people need to wait till next week to order, so the offer is valid till Tuesday.

Second if you have purchased previously an individual MBS Xojo Plugin part from the Complete Set within the last two years, but not the whole set, we offer you an upgrade to the Complete set for the update price. Please consider to get the whole collection of 35 plugins instead of just one plugin.

See also Xojo Thanksgiving Sale and a xojo.io/deals for a collection of offers.

MBS FileMaker Plugin, version 9.6pr1

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

MBS Xojo Plugins, version 19.6pr1

New in this prerelease of the 19.6 plugins:
  • Added new ImageMagick 7.x classes. ImageMagick7MBS and related classes. Works with 8 to 64-bit quantum depth and HDRI support.
  • Updated SQLAPI to version 5.0.2.
  • Updated CURL library to version 7.67.0.
  • Added ThreadCount parameter for TransformLineStrideMT and TransformMT in LCMS2TransformMBS class.
  • Fixed issue with CubeSQL client in SQL Plugin to allow SHOW commands to work.
  • Added LMFitStatusMBS, LMFitControlMBS and LMFitMBS classes for Levenberg-Marquardt least squares fitting algorithm.
  • Added hasDate and hasTime properties to SQLDateTimeMBS class.
  • Fixed bug with random number generator on Windows not always working very randomly on threads. Affected UUIDMBS.randomUUID function used in threads.
  • Removed erroneous deprecation for ValidationMBS class.
  • Updated DynaPDF to version 4.0.35.97.
  • Added LoadFileURL method for WKWebViewControlMBS class.
  • Fixed a few examples to compile for Xojo 2019r2.
  • Updated LibArchive to version 3.4.0.
  • Fixed crash with PDFViewControlMBS control in the Xojo IDE.
  • Improved code for ReadFile in SmartCardMBS to read in chunks of 256 bytes instead of 255 bytes.
  • Fixed crash in SubString() function in RegExMBS when called without an Execute first. Raising exceptions now in this case.
  • Changed graphics for DynaPDFMBS to not try to do transparency if you don't have Lite or higher license.
  • Optimized DynaPDF graphics support to not draw hidden vector objects.
  • Added HasLite and HasPro properties to DynaPDFMBS class.
  • Fixed reference counting problem in Commands() function in SQLDatabaseMBS and SQLConnectionMBS classes causing crashes.
  • Fixed problem in Readers function in SmartCardContextMBS class which may have cut off first character of a reader name.
  • Changed SetLineDashPattern event in DynaPDFParseInterfaceMBS class to pass double array instead of MemoryBlock and phase parameter as double.
  • Fixed crash in Commands functions in SQLDatabaseMBS and SQLConnectionMBS classes.
Download: monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.

Top Reasons for not getting an answer email from us

Customers send support requests, purchase licenses or use our web forms, but later some complain we never answered.
Please check if you may have met one of this conditions:
  • Check if you typed your email address correctly. Copy & Paste the email used and send a test email there. Maybe you missed a letter or swapped a few and don't see it yourself.
  • Check your spam folder for an answer. Sometimes our emails end up in spam folder.
  • Contact us with another email address. If your email server blocks us, we can't easily reach you. A second email address may be handy for us to contact you.
  • Check if you can white list our email address for your mail server.
  • Check if your mailbox on the server is not full. Moving a few emails in your mail app from inbox into a local archive folder may free up space on the server.
  • Send your email again after two days. Sometimes an email just gets lost.
It is sometimes scary how angry people can get if they don't get an answer in time. Sometimes we need to lookup a phone number and call clients to inform them their email is broken.
As usual, this just works fine for 99% of all emails.

Birthday of our video page

Over twelve years ago we started created tutorial videos and today our video page has birthday. Enjoy a video and learn about our plugins.

Over the years we collected more than 80 videos. We hope you enjoy them!

Watch Xojo Videos - FileMaker Videos

Youtube channels:

We know we could make more videos. So what wishes do you have?
Please email us or post a comment here.

Archives

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