CURL Conference 2019 in Prague

The CURL conference (or meet-up) in Prague was a great way to learn a bit more about CURL and how people use it. Especially I leant about the roadmap, HTTP/2, HTTP/3 or Quic and TLS news. The sessions give a great insight what's new in CURL since the last conference, how some internal works and how the project is organized.

The event is organized with great help of some local Czech people from Charles University, which also provided the room. Daniel Stenberg, the author of CURL was of course the star of the show. But there were other notable attendees from various bigger companies including Teamviewer, Akamai, Google, Red Hat, wolfssl, Apiary (part of Oracle) and a few startups where I forgot the names and a few self employed people. The maintainer of wget command line tool came as an attendee. Nice to see them working together on protocol details for their respective open source projects.

Overall the CURL project seems to work well. Activity is growing, more people contribute, the number of tests is growing and even the number of tests to source code lines is raising. They collect money via a donation service and plan to use it to fund a few things including some bug bounty program.

Looking forward to future events! Thanks everyone for organizing and interesting sessions.

Blog post about my presentation: Using system SSL Certificates in CURL

Required keys for info.plist file on Mac and iOS

When you build an application for MacOS or iOS, you may need to set some keys for info.plist. Apple requires for newer MacOS and iOS versions that applications have the info.plist entry and are code signed. If some malicious software would trick itself into getting loaded into a process and try to access your data, the app crashes if the entry is not in info.plist.

In FileMaker, you can add those entries right away in Xcode for your iOS app made with FileMaker iOS SDK. Sometimes for some things, you may even need to add the info.plist entries to the FileMaker Pro app itself.

In Xojo, you can create an info.plist file and drop into the project. Xojo will merge your info.plist file into the one for the application. This is a great way to automatically add the right entries. Other way is to use defaults app in a shell script, which can do that right away when you do code signing.

e.g. in a build script:
Dim App As String = CurrentBuildLocation + "/" + CurrentBuildAppName + ".app"
Call DoShellCommand("/usr/bin/defaults write " + App + "/Contents/Info ""NSCalendarsUsageDescription"" ""Exports events to your calendar.""")

The following table shows possible entries: (more)

Encoded Polyline Algorithm Format

When you work with Google Maps, you may run into their encoding algorithm for coordinates, It is a variation of Base64 specific for encoding floating point numbers in small character chunks.

For MBS FileMaker Plugin, we just add two new functions:

Math.PolylineEncode to encode the number and Math.PolylineDecode to decode it.

e.g. MBS("Math.PolylineEncode"; 38.5) returns _p~iF which than can be decoded with Math.PolylineDecode function.

To build a poly line, you encode the first value, followed with delta numbers.
e.g. given this points: Points: (38.5, -120.2), (40.7, -120.95), (43.252, -126.453)

You chain the calls to our plugin to encode each number:

MBS("Math.PolylineEncode"; 38.5) & MBS("Math.PolylineEncode"; -120.20) &
MBS("Math.PolylineEncode"; 40.7 - 38.5) & MBS("Math.PolylineEncode"; -120.95 - -120.2) &
MBS("Math.PolylineEncode"; 43.252 - 40.7) & MBS("Math.PolylineEncode"; -126.453 - -120.95)

For the given example points, this returns _p~iF~ps|U_ulLnnqC_mqNvxq`@ for all 6 values together. Please note that 2nd and following numbers are deltas.

If you need to know how long an encoded number is, please check ASCII values. The last character is always < 96, e.g. a capital letter.

See Google Development Website

Using system SSL Certificates in CURL

The CURL library supports various SSL backends. We build currently CURL in three variants. The main one uses OpenSSL cross platform. For Windows we build a second copy using Windows own SSL. For MacOS and iOS we build the third variant with transport security. The native SSL libraries from Mac and Windows use the certificates installed on the system, while we need to supply our own certificates for SSL with OpenSSL. You can download cacert.pem with common root certificates from CURL website. Or just use the certificate from your website if you only need to connect to the same server (certificate pinning). We need OpenSSL as SSH2 library uses it for the SSL part.

For MacOS we search the keychain for certificates. We copy the data for each certificate and use OpenSSL function d2i_X509 to parse it. Than we store it in a global std::vector.

For Windows, we open CA, AuthRoot and ROOT stores with CertOpenSystemStore function. We enumerate all certificates and add them to the same vector as for MacOS.

In CURL we use CURLOPT_SSL_CTX_FUNCTION option to set our callback. In the callback, we get the X509_STORE from the SSL context via SSL_CTX_get_cert_store function. We loop over our certificates and add each via X509_STORE_add_cert function. Now all certificates are loaded and we can enable verification.

Sample code: CURLSSLCertificatesWin.cpp and CURLSSLCertificatesMac.cpp.

In our Xojo plugin, simply call UseSystemCertificates method in CURLSMBS class to load certificates into this instance. In FileMaker, please call CURL.UseSystemCertificates function on the CURL session.

Reasons for FileMaker Pro users on MacOS to install MBS Plugin

Over the years we got a lot of free goodies in the MBS Plugin to improve your daily development experience. Please check those 21 features:

1. Rule based syntax highlighting

The MBS Plugin has a default rule set to color script lines and overwrite the colors from FileMaker itself. This includes the use of red color for lines with errors, orange for warnings and colors to detect the type of lines.



In the screenshot you see Perform Script in red as no script is chosen. You also see Set Field without field specified in orange.

And the best: You can customize the rules with the Syntax Colorizer database included with the plugin. Thanks to Russel to make it.

If you select a line belonging to an if or loop block, we highlight the other lines for the same block in light blue. This way you can easily spot where the end if/loop lines are or where the loop is exited early. (more)

SetFrontMost for Windows

You may know the problem that on Windows your app shows several windows and some are behind others windows from other applications. The user may need to click once on all your app windows or use alt-tab key combination to switch to another app and back to get all windows to front.

We'll change that with our plugins by adding new functions to bring a windows app to the front. We activate the frontmost window from the app and arrange all other windows behind it, but before other windows.

For FileMaker Process.SetFrontMost function is now available for Windows in addition to MacOS. To bring an individual window to the front, you can use Window.Activate function.

For Xojo you can now set Application.FrontmostMBS property on Windows, too. We add window.ActivateWindowMBS method to bring a window to the front and set focus. For dealing with all windows on Windows, you can bring a window from another app to the front with ActivateWindow method in WindowsListMBS class.

We hope those two new functions will help you to improve the user experience in your solutions.
e.g. you can bring all windows to front when user clicks on one window.

Coming soon in April with MBS FileMaker Plugin 9.2 betas and MBS Xojo Plugins 19.2 betas.

Anmeldung offen für FileMaker Konferenz 2019 in Hamburg

Vom 16. bis 19. Oktober 2019 findet die zehnte deutschsprachige FileMaker Konferenz in Hamburg, Deutschland statt. FileMaker Anwender und Entwickler können ihre Teilnahme a sofort buchen. Anmeldungen bis zum 21. Juni 2018 erhalten einen Frühbucher-Rabatt auf die Konferenzpauschale.

Möchten Sie Sponsor werden?
Das Programm ist noch nicht fertig, sollte aber bald kommen.

Die Veranstalter vom Verein FM Konferenz erwarten auch 2019 rund 180 Entwickler, Anwender, IT-Fachleute und Entscheidungsträger aus Wirtschaft, Bildung und Verwaltung. Rund um über 25 Fachvorträge und Workshops wird es viel Zeit zum Vernetzen in den gemeinsamen Pausen und beim Abendprogramm geben.

Dieses Jahr gibt es wieder eine MBS Plugin Workshop, diesmal am 16. Oktober 2019.
Anmeldung bei Monkeybread Software.

New Team Website

Recently we got a new team website.

We thought we could add a few faces to the website and show you the people behind the products.

And we listed a few of our partners for development of a few plugin parts. Some of them may join us for the conference.

If you like to meet us, you can see us at the various conferences.

This year Stefanie will join me for Xojo Developer Conference in Miami, FileMaker DevCon in Orlando, MBS Xojo Conference in Cologne and FileMaker Konferenz in Hamburg.

Drag & Drop to a popover coming for next MBS Plugin

As you may know we have Drag & Drop area for FileMaker as part of the MBS FileMaker Plugin. It allows you to drop files, images, emails, attachments, text, rtf, html and more to the FileMaker application. Now we added the feature to place it on top of a popover:



Simply call DragDrop.CreateOnPopoverWithControl or DragDrop.CreateOnPopoverWithSize functions to place the control on top of an open popover. You can put this in the trigger script to run when popover is entered and remove the drop area when the popover is left.

Coming in April/May with MBS FileMaker Plugin's 9.2 release.

WWDC 2019

Today I got a notice from Apple that I won their ticket lottery and got a ticket for WWDC 2019 in San José.

I am looking forward to get into their keynote presentation, get into a few interesting session and meet a few of the engineer who wrote the frameworks I use everyday.

Anyone else coming to WWDC?

This is my 5th attempt to get a ticket for WWDC, so I am happy to get there this year.

I'll certainly add a few extra days to do the sight seeing tour to Apple's two campuses. Maybe I can even stop by FileMaker Inc. and take a look where they do all the development work?

If people are interested we could even make some kind of local meet-up with people from San Francisco or San José area to talk about FileMaker and Xojo?

Replacing plugin on FileMaker Server

Today we run into a little issue with FileMaker Server and our plugin. We have a server with MacOS and our MBS FileMaker Plugin installed. Now we replaced the plugin file with a new version and want to the newer version with the server. But how?

We started in Admin Console for FileMaker and disabled MBS Plugin. Enabled it again and well, the old plugin is back, even if newer file is in Extensions folder!
Same when we disable plugins for script engine. When we enable again, the same plugin becomes active. Seems like FileMaker Script Engine doesn't really try to unload and load again the plugin.

What works is to use Terminal and the command "fmsadmin restart fmse". This will restart the scripting engine and consequently end all running scripts. But it will reload the plugin from disk and you get the new version.
Alternatively you can of course just restart your server machine or restart the whole FileMaker Server, but that would kill all connections.



By the way, the console app is used to show /Library/FileMaker Server/Logs/stderr as this is a place where the log messages from MBS Plugin show up. Our plugin writes a message on startup as well as any requested trace messages.

CURL birthday and conference

Today CURL library and command line tool turns 21 years old. It's a long time in software business and a great success with curl on nearly every computer device on earth as it ships for example with MacOS, Google Chrome, Linux, Android and others.

Since January 2007 and the MBS Xojo Plugin 7.0, we do include CURL for up- and download via ftp/http.

Since January 2012 and the MBS FileMaker Plugin 2.5, we include CURL functions for FileMaker.

And as far as I see, FileMaker Inc. added CURL right to the database engine with version 11 of FileMaker, but only added CURL options for Insert From URL script step with version 16.

See blog post from Daniel Stenberg.

For end of March we have the CURL conference on the agenda in Prague. Please join it if you like to learn more about CURL. See wiki page.

Interested in a meeting for FileMaker or Xojo?
If you are in Prague and like to talk with me, please contact me soon.

How to Convert a PDF document to a PDF/A

A lot of companies need PDF/A for long term archiving. PDF/A should make a barrier-free accessible documents possible after 100 years. Thats because of the tree structure of the elements, which makes it possible to open the document in the future with a screen reader application and it looks the same like 100 years ago when it was created. All fonts and color profiles are embedded to the PDF Document, so no external dependencies cause trouble. 

I want to show how you can do it with our MBS Plugin in FileMaker and DynaPDF.

In our example layout we have two container. One with the name Input for the PDF to process and one with the name Output for the result. You can insert a PDF file by putting your document into the Input container via Drag & Drop. We add a button which calls the following script:


(more)

Adding route planing for MapView in FileMaker

We'll add new function for next plugin release to plan a route for MapView functions:

So when you need to show a route on a map or get the steps, you can use our new MapView.PlanRoute function. Depending on the options, it can show the route, alternative routes as lines on the map, the start and end point as pins. Optionally we can zoom to show the route centered on the map. We can also return the information for the route as JSON blocks, so you can see the locations we found, the steps of the routes and if needed all the points on the map on the route.

Coming soon for Mac and iOS in MBS FileMaker Plugin.

New testimonial from a client

Today we got an email with this nice text:

I want to congratulate you again on such a great plugin. MBS FileMaker Plugin has transformed our solutions into no-compromise tools. It gives a way to answer when we say... "Could that be possible?"... and yes it is when we employ the plugin. Also what I love is I don't have to employ many plugins into a solution. It has all things considered and provides each one thoroughly. I especially love the extras stuff it can do with images and containers. I used to use command line tools with Image Magick and Graphics Magic and hope that I could get FileMaker to play nice. However, your plugin has streamlined the process. Thanks again ☺ Chris Johnston

Thanks Chris for your compliments and see you at the next conference!

Create PDF from scanned images and skip blank pages

When you scan images from a flatbed scanner or document feeder, you may get a collection of image files, one for each page. Than you may want to join them as a big PDF document and you may prefer skipping white pages.

Recently I wrote a script for this task using MBS FileMaker Plugin and DynaPDF.

In my script I scan the pages with our WIA.Scan function and get the list of picture file paths from WIA.Images function. The path is stored at $paths variable in the sample script below. In the following loop I use GMImage.NewFromFile function to load the image file into memory and get back the reference number for the image. This image is converted (if necessary) to the RGB colorspace with GMImage.SetType function. This is a necessary condition for the GMImage.AveragePixelValue function. It calculates the average pixel value and depending of the image content it is more black (0.0) or white (1.0). The function also need the dimensions of the region that should be tested. I want to test the whole page and simply pass the whole image size, queried via GMImage.GetWidth and GMImage.GetHeight functions. 

 

A perfect white page would have an average pixel value of 1.0. But scanners usually do not scan perfect white pages, because dust pollutes the scan result. So we need to test against a little bit smaller value like 0.999. 


(more)

MBS FileMaker Plugin 9.1 - More than 5700 Functions In One Plugin

Nickenich, Germany - (March 12th, 2019) -- MonkeyBread Software today is pleased to announce MBS FileMaker Plugin 9.1 for macOS, iOS, 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, macOS, iOS 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 9.1 has been updated and now includes over 5700 different functions, and the versatile plugin has gained more new functions:

For iOS we got new DocumentPicker functions to show the standard panel to import or open files. You can specify file types and get a script trigged when the choice is made.

When you edit a layout in FileMaker on MacOS, you may notice that the contextual menu to select object style is not sorted. The MBS Plugin can now sort the contextual menu entries alphabetically for you. For the export dialog, you can leave your mouse over a field and our plugin can show via tooltip what type a field has.

If users ask you to implement scrolling though records via mouse wheel, please check the FM.MouseWheelScriptTrigger function. You can get a script triggered to move through records for both MacOS and Windows.

Our AVRecorder functions got an upgrade for Windows, where you can now set the video encoder to use. You can show the standard configure dialog and setup streams, camera controls, and video compression configuration.

DynaPDF got functions to handle optional content in PDF documents (layers). You can query layers, show or hide them and save the new PDF. Table cells can have an action attached for mouse clicks. When printing PDFs with DynaPDF.Print function, you can provide a maximum resolution. The DynaPDF.ReplacePattern function can change text color and WriteFText functions can run in plain text mode.

This version includes three new remarkable example databases:
  1. IMAP Email shows how import emails via IMAP from server into FileMaker and even shows a preview of the email.
  2. Events Sync shows how to synchronizes events in FileMaker with the Calendar database for MacOS.
  3. Scan with WIA to PDF shows how to scan images on Windows from your flatbed or document feeder scanner and convert them to a PDF/A.

To help scanning, you can now use ImageCapture.PDF function to query a PDF document with the images scanned on MacOS. For Windows the WIA.Images provides a list of image files to further process them.

As Apple deprecated older UserNotification functions, we got new UNNotification functions for MacOS 10.14 and newer as well as iOS 10 and newer.

With PKCS7 functions, you can now read p7m files and extract content and certificates. The X509.Read functions read binary files and Socket.Listen can now use a bigger backlog. For our SQL functions in FileMaker, we got new aggregate functions FM.SQL.Min, FM.SQL.Max, FM.SQL.Avg and FM.SQL.Sum.

Finally we upgraded CURL library to version 7.64.0, DynaPDF to version 4.0.26.74, SQLAPI to version 4.2.5 and SQLite to version 3.27.1.

See release notes for a complete list of changes. (more)

Neues MBS FileMaker Plugin 9.1

12. März 2019 - Monkeybread Software veröffentlicht heute das MBS Plugin für FileMaker in Version 9.1, mit inzwischen über 5700 Funktionen eines der größten FileMaker Plugins überhaupt. Hier einige der Neuerungen:

Für iOS haben wir neue DocumentPicker Funktionen um den Standarddialog für Import bzw. Öffnen anzuzeigen. Sie können den Dateityp festlegen und bekommen einen Skriptaufruf, wenn der Benutzer fertig ist.

Wenn Sie ein Layout in FileMaker unter MacOS bearbeiten, ist Ihnen vielleicht aufgefallen, dass die Objektstile im Kontextmenü nicht sortiert sind. Das MBS Plugin sortiert diese Einträge jetzt alphabetisch für Sie. Im Export Dialog können Sie die Maus über einen Feldnamen halten und in einem keinen Infofenster erscheinen Informationen zum Feld. Unser Plugin zeigt Ihnen den Namen vom Feld, der Tabelle und ganz wichtig den Typ des Feldes an.

Wenn ein Benutzer Sie danach fragt, ob man per Mausrad durch die Datensätze navigieren kann, dann schauen Sie sich bitte die FM.MouseWheelScriptTrigger Funktion an. Sie bekommen einen Skriptaufruf für MacOS und Windows bei Benutzung des Mausrades. Ihr Skript kann dann zum nächsten Datensatz weiter blättern.

Unsere AVRecorder Funktionen wurden für Windows überarbeitet. Sie können jetzt den Videokompressor festlegen. Außerdem können Sie die Standarddialoge von Windows anzeigen um die Streams, Kamera und die Kompression zu konfigurieren.

DynaPDF hat einige neuen Funktionen um optionale Inhalte in PDF Dokumenten (Ebenen) zu verwalten. Sie können abfragen welche Ebenen es gibt, einzelne ein/ausblenden und das PDF speichern. Zellen in Tabellen können jetzt Aktionen haben und auf Mausklicks reagieren. Wenn Sie mit DynaPDF.Print ein PDF ausdrucken, können Sie die Auflösung beschränken und mit DynaPDF.ReplacePattern nicht nur den Text, sondern auch die Farbe ändern. WriteFText kann Text jetzt mit oder ohne Formatierung ausgeben.

Diese Version beinhaltet auch drei bemerkenswerte Beispieldatenbanken:
  1. IMAP Email zeigt Ihnen, wie Sie Emails von einem IMAP Server in FileMaker importieren und anzeigen.
  2. Events Sync zeigt wie Sie Termine in FileMaker mit dem Kalender von MacOS synchronisieren.
  3. Scan with WIA to PDF zeigt Ihnen wie man bei Windows Bilder einscannt und dann zu einem PDF zusammenfügt.
Zum Scannen haben wir ein neue ImageCapture.PDF Funktion um alle Bilder vom Scan als ein PDF Dokument zurück zu geben. Für Windows gibt die WIA.Images Funktion eine Liste aller Bilder zum Weiterverarbeiten.

Da Apple die älteren Klassen für Benachrichtigungen (UserNotification Funktionen) als veraltet markiert hat, bieten wir mit dieser Version die neueren UNNotification Funktionen für MacOS 10.14 und neuer sowie iOS 10.0 und neuer an.

Mit den PKCS7 Funktionen können Sie jetzt p7m Dateien lesen und den Inhalt und die Zertifikate auslesen. Die X509.Read Funktionen lesen jetzt auch Binäre Zertifikate und die Socket.Listen Funktion kann jetzt mehr Sockets annehmen. Für die SQL Funktionen in FileMaker haben wir neue Aggregierungsfunktionen FM.SQL.Min, FM.SQL.Max, FM.SQL.Avg und FM.SQL.Sum.

Außerdem haben wir die CURL Bibliothek auf Version 7.64.0, DynaPDF auf Version 4.0.26.74, SQLAPI auf Version 4.2.5 und SQLite auf Version 3.27.1 aktualisiert.

Alle Änderungen in den Release Notes. (more)

MBS FileMaker Plugin, version 9.1pr7

New in this prerelease of version 9.1 of the MBS FileMaker Plugin:
  • Updated DynaPDF to version 4.0.26.75.
  • Changed GraphicsMagick to detect installed fonts at runtime for MacOS instead of hard coded list.
  • Fixed problem with Events.Reset function.
  • Fixed bug in handling 16-bit color for GraphicsMagick, which affected the trim and replace color examples.
  • Fixed an issue with WebViewer not found for Popover controls. (bug from pr1)
Download at monkeybreadsoftware.de/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder.

Send text message from FileMaker via iMessage

A client recently asked how to send text messages (SMS) via iMessage. Instead of using a web service of some provider, he only has to occasionally send a few messages automated over his iPhone. So we got the following AppleScript for him:

 

property targetPhone : ""

property targetMessage : ""

 

on run

tell application "Messages"

set targetService to 1st service whose service type = iMessage

set targetBuddy to buddy targetPhone of targetService

send targetMessage to targetBuddy

end tell

end run

 

This script has two properties for the phone number (or email) and the message to send. The script asks Messages app on MacOS for the first service for iMessage and for the buddy with the given phone number. Than it sends a message to the buddy.

(more)

Login in FileMaker web viewer if needed

Sometimes you may want to show a website in a webviewer, but a login is required. We solved this for a client today with the following script. First we go by script to the website. If we have to login, there is a login form, so we set the user name and password. If the field is not found, we are logged in and exit the script. Otherwise we click the login button and continue to the final website:

 

 # Load website

Set Web Viewer [ Object Name: "web" ; URL: "https://somedomain/search" ] 

# Wait for it

Loop

Pause/Resume Script [ Duration (seconds): ,1 ] 

Exit Loop If [ MBS("webview.isloading"; "web") ≠ 1 ] 

End Loop

# Set login name

Set Variable [ $r ; Value: MBS( "WebView.SetFormInputValue"; "web"; "login_form"; "__ac_name"; "xxx") ] 

If [ MBS("iserror") ] 

# No form, so we are already logged in?

If [ Position ( $r ; "failed to find form" ; 1 ; 1 ) = 0 ] 

Show Custom Dialog [ "Failed to set username field." ; $r ] 

End If

Exit Script [ Text Result:    ] 

End If

# Set password

Set Variable [ $r ; Value: MBS( "WebView.SetFormInputValue"; "web"; "login_form"; "__ac_password"; "xxx") ] 

If [ MBS("iserror") ] 

Show Custom Dialog [ "Failed to set password field." ; $r ] 

End If

# Wait

Pause/Resume Script [ Duration (seconds): ,1 ] 

# Click login button

Set Variable [ $r ; Value: MBS( "WebView.ClickInput"; "web"; "login_form"; "submit") ] 

If [ MBS("iserror") ] 

Show Custom Dialog [ "Failed to click submit button." ; $r ] 

End If

# or submit form

// Set Variable [ $r ; Value: MBS( "WebView.formsubmit"; "web"; "login_form") ] 

// If [ MBS("iserror") ] 

// Show Custom Dialog [ "Fehler" ; $r ] 

// End If

# Wait for page loading after login

Loop

Pause/Resume Script [ Duration (seconds): ,1 ] 

Exit Loop If [ MBS("webview.isloading"; "web") ≠ 1 ] 

End Loop

# Go to search page where we want to be after login

Set Web Viewer [ Object Name: "web" ; URL: "https://somedomain/search" ] 

Next user can do a search and find information to use in the FileMaker solution. If needed, our plugin can assist to extract text or html live content from the web viewer as well as query content of certain DOM elements via JavaScript (see WebView.RunJavaScript) . In case the website changes layout, you may need to adjust the script with new form and field names.


Read patient name from Swiss Health Card

Here a snippet from MBS Plugin training today. The health cards used by people in Switzerland (VVK 832.105 und eCH-0064) include various interesting values to identify the patient like his name, ID and the health insurance name. We can read the values via several standard readers. If you like, you can read various values from file 2F06 with birth date, name, card holder ID and 2F07 with insurancer name, card ID and expiration date. Here a short sample script to read the name of the patient:
 

# Initialize smart card:

Set Variable [ $$SmartCard ; Value: MBS( "SmartCard.Init" ) ] 

If [ MBS("IsError") ] 

Show Custom Dialog [ "Failed to initialize SmartCard" ; $$SmartCard ] 

Exit Script [ Text Result:    ] 

End If

# Connect to a reader

Set Variable [ $reader ; Value: "Identiv SCR3310 uTrust 2700 R" ] 

Set Variable [ $r ; Value: MBS( "SmartCard.Connect"; $$SmartCard; $Reader; "Shared"; "any" ) ] 

If [ MBS("IsError") ] 

Show Custom Dialog [ "Connect failed" ; $r ] 

Exit Script [ Text Result:    ] 

End If

# Read file from smartcard with APDU protocol.

# Read record with name

Set Variable [ $result ; Value: MBS( "SmartCard.ReadFile"; $$SmartCard; "2F06") ] 

If [ MBS("IsError") ] 

Set Field [ Card::Status ; $result ] 

Show Custom Dialog [ "Error" ; $result ] 

Exit Script [ Text Result:    ] 

End If

# Pick result

Set Variable [ $filedata ; Value: Middle ( $result ; 5; Length($result) ) ] 

# Split in values

Set Variable [ $json ; Value: MBS("SmartCard.SplitValues"; $FileData) ] 

# Get item 128, which is full name

Set Variable [ $name ; Value: JSONGetElement ( $json ; "128" ) ] 

Set Variable [ $NameList ; Value: Substitute($name; ", "; ¶) ] 

Set Variable [ $LastName ; Value: GetValue($nameList; 1) ] 

Set Variable [ $FirstName ; Value: GetValue($nameList; 2) ] 

Show Custom Dialog [ "Name" ; $FirstName & " " & $LastName ] 

Set Variable [ $r ; Value: MBS( "SmartCard.DisConnect"; $$SmartCard; "Eject") ] 


This connects to reader, reads the rigth file, decodes values and shows the name of the patient. Other values are available in the json object.

Tooltips for the FileMaker export dialog

Recently a developer contacted us. They have to handle several databases of their clients and all have different naming schemes for fields. In the export dialog, they don't know which fields are formulas, statistic or global fields. If the name doesn't say it, you may not know it in the dialog. Of course they can switch to the database definition dialog and take a screenshot of the fields list. But it would be easier to see the type information directly in the export dialog.

Here you see a screenshot composition with six different tooltips at once. When the system needs a tooltip MBS Plugin looks up the table and field names and queries the type information via SQL to display in the tooltip. So you may see field names like varchar (text), decimal (numbers), binary (containers) and calculated (formula). Repetitions are showed in brackets and global fields have a global prefix to the type.

The feature is available for MacOS in the new 9.1pr6 version of MBS FileMaker Plugin. We hope you enjoy it!

MBS FileMaker Plugin, version 9.1pr6

New in this prerelease of version 9.1 of the MBS FileMaker Plugin:
  • Added PKCS7 functions to read signed data.
  • Added tooltip for Export dialog for MacOS. If a table name is selected in popup, we can show field type in tooltip for list entries.
  • Added WordFile.AddMediaFile function.
  • Added backlog parameter for Socket.Listen.
  • Manually applied CURL fix: vauth/oauth2: Fix OAUTHBEARER token generation #3377
  • Changed web viewer made with WebView.Create to open links with target=_blank in browser.
Download at monkeybreadsoftware.de/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder.

Dialogs made in FileMaker

Sometimes you need a dialog to ask the user a few details your FileMaker solution. Maybe a selection dialog or a small input for a few text fields. FileMaker can open dialog boxes that show a layout with the new window script step. The layout used can look like a dialog and provide buttons to close the dialog. Since FileMaker 16 introduced the card style for windows, you can use dialogs as well as cards in a window.

 

Dialog Window

 

Basically, we have a little problem with such dialogs in a script. Usually the script ends and the button triggers later the next script to complete the work. This is annoying, because the flow in the script is interrupted and you can handle everything in one script. Local variables are gone with the end of the script and the context needs to be recreated in the second script.

 

We got a solution recently: While the dialog is displayed, the calling script waits in a script pause and continues as soon as the dialog is finished. This allows the result to be further processed directly in the script. Here is the sample script for a dialog:

 

Set Variable [ $x ; Value: Get ( ScreenWidth ) / 2 - 200 ] 

Set Variable [ $y ; Value: Get ( ScreenHeight ) / 3 - 100 ] 

New Window [ Style: Dialog ; Name: "Dialog" ; Using layout: “Card” ; Height: 240+20 ; Width: 400 ; Top: $y ; Left: $x ] 

Show/Hide Toolbars [ Hide ] 

Loop

Pause/Resume Script [ Indefinitely ] 

Set Variable [ $Result ; Value: Get(ScriptResult) ] 

Exit Loop If [ Length($Result) > 0 ] 

End Loop

#

Close Window [ Name: "Dialog" ; Current file ] 

Set Field [ Dialog Test::Result ; $Result ] 

 

Let's go through the script line by line. First, let us define where the dialog should appear on the screen. The width and height of the screen are divided and half size is subtracted for the dialog. Horizontally we take the middle of the screen. Vertically we take a third, so that the dialog appears further up on the screen. The new window script step takes Dialog as window type. We use the layout called "card" (in the example file) and the corresponding size. Width and height depend on the size of the layout. This layout shows the text for the dialog, possibly some input fields and at least one button to close the dialog. In order to make sure that no toolbar is displayed, we hide the toolbar explicitly.

 

The loop in the script sets an unlimited script break. The pause gives the user time to use the dialog. If the user continues the script, the loop will pause directly again. We get the result of the dialog via the script result function and finish the loop as soon as we have a result. When the user has decided, we close the window after the loop. With $Result we can continue our script. In the example, this information is only written to a field.

(more)

Newer IMAP Email example for FileMaker

Have you seen our new email example for loading emails via IMAP?

We'd like to show you our newest email example to receive emails:

In this example you can enter your email server, user name and password. Than you can click load email list and the plugin will load the list of all emails and show them as records in the database:



This is just the list of emails we loaded. For each email we get the basic information and if needed, you can click "Load Email" button to load the actual email from the server. (more)

MBS FileMaker Plugin, version 9.1pr5

New in this prerelease of version 9.1 of the MBS FileMaker Plugin:
  • Added WinSendMail.SendAsync function.
  • Fixed bug with image indexes for DynaPDF.AppendImagePages function.
  • Updated SQLAPI to version 4.2.5.
  • Fixed a problem with XML.Parse getting an XML reference number.
  • Added feature to sort layout style entries in context menu in FileMaker layout editor.
  • Changed script search to delay search a few milliseconds to avoid search while typing.
  • Fixed problem with Printer.Print picking items in popup menu if you have two similar starting entries.
Download at monkeybreadsoftware.de/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder.

Sorted object style contextual menu in FileMaker

Recently we got notice that some people have really a lot of styles and would appreciate if the menu could be sorted alphabetically. So with next MBS FileMaker Plugin, our plugin will sort the context menu for you:



Please try later today with version 9.1pr5 and let us know whether you like it or if you see any problem. The feature is implemented for FileMaker 15 and newer. As usual we change as little and have a lot of checks there, so if someday FileMaker gets new menus, the plugin will do nothing.

Archives

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