Our Blog, Filemaker only, Xojo only, Archive (older)

Follow us on Twitter, Xing, LinkedIn or Facebook.

Storing files for download on FileMaker Server with download URLs


As you may know the FileMaker Server comes with a copy of apache web server software. You can use the apache web server to host and deliver files for download. So if you copy a file to /Library/FileMaker Server/HTTPServer/htdocs/ folder on your server, you can than point to that file with the URL of your server with folder and file name attached.

 

We can call the following script named "Create URL". It calls a script on the server to export the picture of our current record and return the URL. As server doesn't retain the context, we need to pass the record ID fo the current record as parameter:

 

Perform Script on Server [ Specified: From list ; “Create URL on Server” ; Parameter: Get(RecordID) ; Wait for completion: On ]

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

Set Field [ Anlagen::Name ; $URL ] 

 

The script Create URL on Server looks like this:

 

# go to record on Server

Set Variable [ $RecordID ; Value: Get(ScriptParameter) ] 

Go to Layout [ “Images” (Anlagen) ; Animation: None ]

If [ Get(LastError) ≠ 0 ] 

Exit Script [ Text Result: "" // failed ] 

End If

Go to Record/Request/Page [ With dialog: Off ; $RecordID ]

If [ Get(LastError) ≠ 0 ] 

Exit Script [ Text Result: "" // failed ] 

End If

# Global settings

Set Variable [ $path ; Value: "/Library/FileMaker Server/HTTPServer/htdocs/" ] 

Set Variable [ $URL ; Value: "http://127.0.0.1/" ] 

Set Variable [ $folderName ; Value: Get(UUID) ] 

# Item to export

Set Variable [ $Container ; Value: Anlagen::Bild ] 

Set Variable [ $FileName ; Value: MBS( "Path.LastPathComponent"; GetAsText($Container)) ] 

# Create folder

Set Variable [ $FolderPath ; Value: MBS( "Path.AddPathComponent"; $path; $FolderName ) ] 

Set Variable [ $r ; Value: MBS( "Files.CreateDirectory"; $FolderPath ) ] 

If [ MBS("IsError") ] 

Exit Script [ Text Result: "" // failed ] 

End If

# Export file

Set Variable [ $FilePath ; Value: MBS( "Path.AddPathComponent"; $FolderPath; $FileName ) ] 

Set Variable [ $r ; Value: MBS( "Container.WriteFile"; $Container; $FilePath ) ] 

If [ MBS("IsError") ] 

Exit Script [ Text Result: "" // failed ] 

End If

# Return URL

Set Variable [ $FileNameURL ; Value: MBS( "Text.EncodeURLComponent"; $FileName; "UTF8" ) ] 

Set Variable [ $result ; Value: $URL & $FolderName & "/" & $FileNameURL ] 

Exit Script [ Text Result: $result ] 

 

As you see, we create a new folder with an UUID as name, so every user has an unique folder. We write the file there and build the URL with the encoded file name. Now the client script has the URL and you can give it the user, e.g. in an email to download later. 

 

It may be good to put all those downloads in an extra folder so the folder is not filled too much. Also we could store the folder names in a table with timestamp, so we can remove them after e.g. 30 days.


Missing LSSupportsOpeningDocumentsInPlace for iOS Apps


If you recently submitted a FileMaker iOS app to the App Store, you may have got the following message from Apple:

Invalid Document Configuration - Document Based Apps should support either the Document Browser (UISupportsDocumentBrowser = YES) or implement Open In Place (LSSupportsOpeningDocumentsInPlace = YES/NO)


Once again Apple improves the automatic checks on applications to find bugs in the configuration. The FileMaker app declares in the info.plist file in the bundle, that it works as editor for a few file types. For an iOS app, this usually includes the FileMaker Document type with the extension fmp12 (unless you change that).

An application declaring file types must specify whether it can open them in place or needs copies to work on. This is new since the introduction of the iCloud file synchronization. To fix, you'd need to add the missing LSSupportsOpeningDocumentsInPlace key to the info.plist file.

In Xcode, please locate to the project settings and there to the target settings. In the Info tab you find the info.plist settings for the applications. In the section for custom iOS target properties, you add a new entry with the following values:

Name: Supports opening documents in place
Type: Boolean
Value: NO

Please try and see if your app still runs. As we expect that FileMaker may not do the extra coordination for secure scoped bookmarks, we use the value NO above, so the OS may do copy files to temp folder for FileMaker to access them.

The key is documented here on the Apple developer website in the LSSupportsOpeningDocumentsInPlace section.

Ein Monat bis zur FileMaker Konferenz 2018 in Malbun


Nur noch einen Monat bis zur FileMaker Konferenz 2018 in Malbun (Liechtenstein) und zur MBS FileMaker Plugin Schulung am Mittwoch vorher.

Vom 17. bis 20. Oktober diesen Jahres findet die neunte deutschsprachige FileMaker Konferenz in Malbun, Liechtenstein statt. FileMaker Anwender und Entwickler können ihre Teilnahme hier buchen.

Die Veranstalter vom Verein FM Konferenz erwarten auch 2018 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.

Für den Deutschsprachigen Raum ist diese Konferenz das Treffen des Jahres. Hier finden Sie vom Anfänger bis zum Profi Kontakte zu anderen Entwicklern und vor allem den Kontakt zu den FileMaker Mitarbeitern. Lernen Sie was es neues gibt, lernen Sie wie man Probleme löst und erzählen Sie den FileMaker Mitarbeitern was Sie sich für die Zukunft bei FileMaker wünschen!

Die MBS Plugin Schulung findet am 17. Oktober 2018 statt.

Meetings at Consumer Electronics Show CES 2019 in Las Vegas?


For 2019, I have the chance to visit the Consumer Electronics Show in Las Vegas in early January.
Years ago I visited the Cebit here in Germany, but the CES will be bigger and show more hot new stuff. I hope to see a lot of innovative things to inspire me for future projects.

Anyone else going to CES next year?

In case we may have an extra meeting with developers, I made two surveys:

Survey for Xojo Meeting and Survey for FileMaker Meeting

If you are interested in consulting, training or custom development around our plugins, please contact me for a private appointment.

MBS FileMaker Plugin, version 8.4pr9


New in this prerelease of version 8.4 of the MBS FileMaker Plugin:
  • Improved CoreML.AddImageParameter function to auto scale image to required size.
  • Fixed JSON.ToHTML to return text with CR as line ending.
  • Updated SQLite to version 3.25.0.
  • Updated LibXL to version 3.8.3.
  • Updated DynaPDF to version 4.0.23.61.
Download at monkeybreadsoftware.de/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder.

Using Emojis in FileMaker


As you may know, FileMaker uses Unicode text with 16bit, so Character() function doesn't work with the bigger codes for getting emojis like 128512.

As an example you can go to the Full Emoji List and pick a smily. e.g. first one has unicode code point 1F600, which is a hex number, so we convert it using the calculator or Math.HexToDec function. This gives us 128512 and char(128512) gives just a wrong result. But our MBS( "Text.Character"; 128512 ) function call works and returns the smiley as text: 😀.



We can also get flags by using Text.Character and the right magic number or the start: 127397. If you add the ascii code of the letters for the country, you get back the unicode characters forming the flags.

Here Germany (DE) as example:

MBS( "Text.Character"; 127397 + Code ( "D" )) & MBS( "Text.Character"; 127397 + Code ( "E" ))

This returns 🇩🇪. Try it for your country!

In Xojo, this calculation would be:

Encodings.UTF8.Chr(127397+asc("D"))+Encodings.UTF8.Chr(127397+asc("E"))

DbgView for watching trace messages live on FileMaker Server


The little DebugView application from Microsoft can be very useful to see the debug messages from various applications. If you run it as admin on Windows and set the option in the menu to capture global Win32 messages, it will show the debug messages from our plugin used by FileMaker Server:



As you see MBS FileMaker Plugin on Server always prints this welcome line including version, platform, 32/64bit, which FileMaker process and the version of the FileMaker SDK reported by the loading FileMaker application.

If you use MBS("Trace") without a file path, you will see all calls to plugin functions in the log, too. This is very handy to have a live view on what's going on with the plugin. If you set the option to trace only errors with Trace.ErrorsOnly, you only see the calls which return an error message.

Use Machine Learning for detecting porn images


Today at the Macoun conference, I visited the session about CoreML and for a nudity scanner. This included the pointer to the following CoreML model to detect nudity in pictures. That's great, if you get pictures from users and you want to know whether they include any porn pictures.

You can download the model here: Yahoo's Open NSFW detector with Core ML as part of an open source project. In the download, please locate the OpenNSFW.mlmodel file and put the path into our CoreML.fmp12 example FileMaker database or the CoreML Xojo project coming with MBS Plugins.



When you run this model with a porn image, you may get an output like this:

{
  "classLabel" : "NSFW",
  "prob" : {
    "SFW" : 0.34505009651184082,
    "NSFW" : 0.65494996309280396
  }
}

for a normal picture of something else, you may get this output:

{
  "classLabel" : "SFW",
  "prob" : {
    "SFW" : 0.97758579254150391,
    "NSFW" : 0.02241421677172184
  }
}

As you see this model has only two classes SFW (safe for work) and NSFW (not safe for work) to categorize images in. For each we get the probabilities and the classLabel for the most likely class.

This can be used in various projects in both FileMaker and Xojo. Whatever image you get to post on social platforms, add to your image database or upload to your CMS, you can pre-check images. Whether you warn the user only, mark them as porn or decline them is your choice.

We are looking forward to improvements in MacOS 10.14 Mojave and iOS 12. Looks like CreateML lets you really easily create new models.

For other models, please check the awesome list of models for Core ML here: github.com/likedan/Awesome-CoreML-Models. There are some really cool models like predicting location of a picture, what type of food you got on a picture or gender classification for names.

MBS FileMaker Plugin, version 8.4pr8


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

FileMaker iOS SDK and MBS Plugin Video


In our new video, we show you how to embed the MBS Filemaker Plugin 8.4 into the app made with FileMaker iOS SDK 17.0.3:



The steps I did in the video are:
  • Get MBS Plugin for iOS SDK from the 8.4 download.
  • Get FileMaker iOS SDK from the community download.
  • Unpack iOSAppSDKPackage_17.0.3 archive.
  • Optional remove quarantine stuff via Terminal: xattr -c -r /Users/cs/Desktop/iOSAppSDKPackage_17.0.3
  • Change SignScript and run via terminal to sign plugins.
  • in Terminal move to right folder: cd /Users/cs/Desktop/iOSAppSDKPackage_17.0.3
  • In Terminal make new project: ./makeprojdir test test de.monkeybreadsoftware.test
  • Add button in placeholder.fmp12 to show dialog with version: MBS("Version") & ¶ & MBS("Platform")
  • Copy MBS.fmplugin.framework from simulator folder to the plugins folder
  • Run in Simulator
  • Copy plugin for device into project.
  • Setup Codesigning with company team.
  • Select device
  • Run on device
  • Take screenshot in Devices Window
If you run into problems, let me know.
You may see logs in Xcode with messages about wrong architecture (simulator vs. device), if you picked wrong plugin file. Also if plugin doesn't load on device, it may not be properly signed.

As of today, we can't submit it to App Store as a little thing needs to be changed in FileMaker iOS SDK: Issue 787652

90 Countries


Today we added Armenia, Mosambik and Guadeloupe to the list of countries as we got recently new customers for those countries.
Now we are at 90 countries for MBS FileMaker Plugin and here are the top 12 countries:



As you see people from German speaking countries love to use our plugin as they may prefer support in German, while rest of world needs to know English or German.

12 years since MBS FileMaker Plugin version 1.0


Today twelve years ago we released the MBS FileMaker Plugin in Version 1.0.
Here the original announcement:

[ANN] MBS Plug-in For Filemaker

Make FileMaker Windows Semi Transparent!
Take Screenshots from FileMaker
Run an Applescript on field exit
and more...

Monkey Bread Software, maker of the popular MBS Plug-in for RealBasic and geist interactive have teamed up to bring the extensive MBS function library to FileMaker. The MBS RealBasic plug-in contains over 10000 functions, and this release represents the first step in a project to bring as many of those functions to FileMaker as make sense. Many many more features to com in the future.

The plug-in is available for FileMaker 8 and 8.5. It is available for Windows XP and as Universal Binary for Mac OS X There is a Developer Tool available to help you get started quickly with documentation and Calculation builder. Demos are available on the website

more info: geistinteractive.com
download: monkeybreadsoftware.de/filemaker/

Read also: 4000 functions in 10 years and 5000 Functions in MBS Plugin.

Thanks for the support over years. If you need a license: Try coupon code TwelveYears for orders via Share-It.

FMnext Experience II in Meilen, Schweiz


Am 20. November 2018 veranstaltet die Medio-Ingeno AG einen FileMaker Event in Meilen am Zürichsee:

FMnext Experience II

Zahlreiche FileMaker Vorträge am Abend, Empfang und einem unterhaltsames Special am Ende.
Bitte den Termin vormerken und frei halten.

MBS Schulung

Aktuell organisieren wir noch eine MBS Schulung für den gleichen Tag vorher (ab 9 Uhr). Dafür stellen wir momentan noch das Programm zusammen:

Wir starten mit dem Überblick was im MBS Plugin neu dabei ist dieses Jahr. Dann natürlich die Schweizer Einzahlungsscheine nach ISO 20022 mit den Details rund um Barcodes. Dazu noch die Shell Funktionen im MBS Plugin um das FileMaker Migration Tool aus einer FileMaker Lösung heraus zu steuern und automatische Migrationen zu bauen.

Weitere Themenwünsche bitte baldmöglichst an mich schicken.

Anmeldung FMnext Experience II und Anmeldung für MBS Schulung

MBS FileMaker Plugin, version 8.4pr7


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

MBS FileMaker Plugin, version 8.4pr6


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

Live barcode reading for FileMaker on MacOS and iOS


We got the live barcode reading working with the AVRecorder functions in MBS FileMaker Plugin. We now have the option to automatically feed the recorded images to the CoreImage detector to find QRCodes:

This works nice and can optionally triggers a script for a new barcode. So you should be able to have your users hold a QRCode in front of the iPhone or Mac camera and get the barcodes coming in. The advantage is that we do the processing and detection on a preemptive thread, so it runs in background and doesn't block FileMaker from doing other things.

Of course you always get current frame with AVRecorder.CaptureStillPhoto and pass it to OCR.SetImage for text recognition or Barcode.Detect to find different barcodes yourself. That even works on Windows.

Coming soon with next prerelease of MBS Plugin 8.4.

MBS FileMaker Plugin, version 8.4pr5


New in this prerelease of version 8.4 of the MBS FileMaker Plugin:
  • Added new Keychain functions.
  • Changed plugins to load LDAP framework dynamically instead of linking to it directly.
  • Improved variable checking to recognize Insert Text, Insert time, Insert date, Insert current user and Insert Calculated Result and look for variables there in 11 languages.
  • Fixed a problem on Windows with Drag & Drop functions not accepting drag if you didn't set cursor.
  • Added SignScript for iOS plugins.
  • Added XML.ApplyStylesheet function.
  • Added LibXSLT in version 1.1.33.
  • Updated LibXML2 to version 2.9.8.
  • Added CNContactStore.GroupsByName and CNContactStore.GroupsForContact functions.
Download at monkeybreadsoftware.de/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder.

FileMaker and WebViewer communication


A lot of FileMaker developers love to interact with WebViewer. There are a couple of ways to move data in/out or call back to FileMaker. For a few things our plugin can help a lot.
Here an overview:

Load webpage into WebViewer:

  • Use FileMaker's Set Webviewer Script Step to pass in URL with content.
    This is limited to a few thousand characters and URL may get logged.
  • Write local HTML file and call Set Webviewer Script step with an URL pointing to the file. Path.FilePathToFileURL may help here.
  • Use WebView.LoadHTML in MBS Plugins to load HTML from text in variable or field.
  • Use WebView.LoadURL to load URL.
    Pass for Mac and iOS the cache policy and the timeout value.

Calling JavaScript:

  • You can use MBS Plugin WebView.RunJavaScript which will pass the javascript to run. For Mac and iOS, this function returns the result, while on Windows, we can't get the result.
  • Use WebView.RunJavaScriptReturnTitle which is designed to return the title of the document. In JavaScript you can put result in document.title and we pass it back. This may not work well with line breaks.

Pass data to JavaScript:

Trigger Script from JavaScript:

  • Use fmp URL to trigger a script. May run the wrong version of FileMaker.
  • Use Webview.AddScriptMessageHandler to trigger script from JavaScript for FileMaker 16 and newer with Mac & iOS
  • Use WebView.InstallCallback to trigger script for FileMaker 15 and earlier on Mac and Windows with IE 9 or older.
  • Use ServerSocket.Start to listen to requests and send HTTP Request via XMLHttpRequest in JavaScript.
  • Use Data API on FileMaker Server via requests sent from JavaScript.

Pass back data from JavaScript:

If you know more to add here, please comment or email us.

Playing with LibXSLT


For our plugins I updated libxml2 to a newer version. And while doing that, I saw there is also libxslt available, which can be used together with libxml2 to support XSLT.

So I built LibXLST for all platforms (2x Mac, 4x iOS, 3x Linux and 2x Windows!) for me. Once the libraries can be linked to the plugin, I started make a new function for the MBS FileMaker Plugin: XML.ApplyStylesheet.

It allows you to apply a style sheet to an XML document and transform the XML to something new. Fore example you transform from one XML to other. This includes transforming XML to just text or html text. We'll certainly include a few examples with next plugins.

If you have ideas for more functions, please let me know.

By the way XSLT 2.0 is a common wish, but the problem is that there aren't many libraries for C/C++ doing that. And for example the Saxon library is quite expensive for redistribution.

Xojo has such a function built-in: XMLDocument.Transform, so no need currently for a plugin there.

Acht Wochen bis zur FileMaker Konferenz 2018 in Malbun


Nur noch acht Wochen bis zur FileMaker Konferenz 2018 in Malbun (Liechtenstein) und zur MBS FileMaker Plugin Schulung Mittwochs vorher.

Vom 17. bis 20. Oktober diesen Jahres findet die neunte deutschsprachige FileMaker Konferenz in Malbun, Liechtenstein statt. FileMaker Anwender und Entwickler können ihre Teilnahme ab sofort buchen.

Die Veranstalter vom Verein FM Konferenz erwarten auch 2018 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.

Für den Deutschsprachigen Raum ist diese Konferenz das Treffen des Jahres. Hier finden Sie vom Anfänger bis zum Profi Kontakte zu anderen Entwicklern und vor allem den Kontakt zu den FileMaker Mitarbeitern. Lernen Sie was es neues gibt, lernen Sie wie man Probleme löst und erzählen Sie den FileMaker Mitarbeitern was Sie sich für die Zukunft bei FileMaker wünschen!

Die MBS Plugin Schulung findet am 17. Oktober 2018 statt.

Older blog entries:

2018-08-22 FileMaker Stammtisch Nürnberg
2018-08-21 MBS FileMaker Plugin, version 8.4pr4
2018-08-20 FileMaker 17 Launch Presentations in Belgium and Netherlands
2018-08-19 Tip of the day: Split large files into smaller chunks
2018-08-18 Why you need the Migration Assistant to move to a new Mac
2018-08-17 FileMaker Stammtisch in München
2018-08-16 MBS FileMaker Plugin, version 8.4pr3
2018-08-15 New MacBook Pro tested
2018-08-15 QLPreviewPanel functions for iOS
2018-08-11 FileMaker Excellence Award
2018-08-10 MBS FileMaker Plugin, version 8.4pr2
2018-08-10 See you at the next FileMaker DevCon
2018-08-09 On stage at DevCon
2018-08-08 New Contacts functions for FileMaker
2018-08-07 MBS Plugin Presentation at DevCon
2018-08-06 MBS Booth ready for FileMaker DevCon
2018-08-06 Arrived in Grapevine, Texas
2018-08-01 MBS FileMaker Plugin, version 8.4pr1
2018-07-31 MBS Plugin Presentation for FileMaker DevCon 2018
2018-07-28 Adding Bonjour functions for MBS FileMaker Plugin

Archives

Sep 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
XML: RSS Feed XML: Atom Feed