Best way to interact with FileMaker?

I am pondering about a problem for some time but have found no good solution yet. Hopefully some of you have some advice:

I created a module to read German “health card” data – client cards health insurance companies give their customers for faster identification if you visit a doctor or hospital. The program is meant be used in conjunction with FileMaker (which I did not use since version 12, so my knowledge about it is a bit outdated).
What would be a good way to establish a communication between FM and a Xojo app xplatform for Windows and macOS? FileMaker can use cURL, but the demo project I found so far is used for a REST API and running the Xojo app as a local Webservice seems a bit oversized to me. Or isn’t it?

AppleScript works more or less on the Mac side. Filemaker is finicky and wants to be left alone when it adds data. On FMP12 there is a huge memory leak when you add too much data. Haven’t checked in later versions. XML works fine if you don’t have much data. Again this was a problem with FMP12.

My app writes the XML where Filemaker can find it. Then the app calls a Filemaker script which does the import and sets a variable so that my app knows when the import is finished.

On my agenda is to look at what the MBS plugin could do to improve this.

Thanks, Beatrix! FM 12 is not a problem anymore; I was granted a FM 15 license.

AppleScript won’t do because I need a solution for Windows too. And I dislike the idea to write sensitive data to the HD (well, in the module I have to because some of the data comes as a zipped file …).
It would be nice to be able to address the Xojo app as a console app, but that does not work without AppleScript – or is there a way?

I think ODBC can also work.

see my Xojo for FileMaker developer talk from years ago:
http://www.monkeybreadsoftware.de/filemaker/files/Presentation/

Have you asked Tim Dietrich?

Webinar from 3 days ago

Yes, I’ve seen it, but if I understood it correctly it is about Web services including FM server. Brilliant but not what I am looking for. The target should be an FM desktop installation.

[quote=359744:@Christian Schmitz]I think ODBC can also work.
see my Xojo for FileMaker developer talk from years ago:[/quote]
Great stuff! But for a two way communication I would have to use a timer to query for an FM request, I guess. I would rather like to have a real communication system like a socket or addressing a console app. There is no equivalent for AppleScript in FM Windows, right?

Ulrich - if find a solution PLEASE let me know!

You want to communicate without FileMaker Server?

Can you use URL to communicate? From Xojo you can use an fmp:// url to run scripts in FM: http://isolutions-inc.com/fmp-url-scheme-and-the-13-0v2-improvement/

Hi Bill,

thanks to Hal’s and Tim’s help, I found a solution to make FM and Xojo communicate via a ServerSocket/TCPSocket. So this works even with a console app. Feel free to contact me in a PM for further details.

Hey Ulrich,

Would you be able to create an article and a demo? It’d be an awesome resource! Maybe send the message a show a MsgBox on either side?

I did one on my German blog: https://xojoblog.me/2017/11/23/1-x-filemaker-zu-xojo-und-zurueck-bitte/

I wouldn’t be surprised if the internal Google translation is a bit cryptic, so please let me know if you need more details.
After checking the translation myself: Google translation is almost completely, but not perfectly no English at all …

The blog post is more complex than the code : - )

This is totally fascinating but only a simple test. You also need a method to start this from Xojo and you need to know when Filemaker is finished. Can you transport a lot of data with this or only small amounts? What about multiple fields? Then you need to start thinking about pickling and unpickling. Parsing data with Filemaker likely is yucky. What about encodings? What about container data? Which is my biggest problem at the moment because Filemaker needs to be in front when it imports data into a container.

When you stare at Filemaker long enough it usually becomes sulky. I tried to import an 8 MB XML file into Filemaker 16 last week and it became unresponsive. Most of the data was a CData section! Converting the blob into base64 works fine but this is slower than my initial solution because converting the data back in Filemaker is so slow.

So Filemaker is lots of fun!

[quote=361434:@Ulrich Bogun]I did one on my German blog: https://xojoblog.me/2017/11/23/1-x-filemaker-zu-xojo-und-zurueck-bitte/

I wouldn’t be surprised if the internal Google translation is a bit cryptic, so please let me know if you need more details.
After checking the translation myself: Google translation is almost completely, but not perfectly no English at all …[/quote]

It translated to English very nicely and the example files worked great! Thanks, Ulrich.

I was wondering why you decided to use a Console App rather than a Web App?

For starting from Xojo, use a FMP:// URL. It will bring FM to the front automatically.

Simply send an “ack” to Xojo.

Multiple values can be received by wrapping the values into tags or sending a JSON as string (which I could not test because that’s a FM 16 function). The idea of the article was not to create a fully developed library but to show how both apps can communicate.
As the transmission is done via a TCPSocket, I could not find any limitations like hangs or transmission errors. I could successfully transmit millions of characters without problems. Of course, longer calculations might take some time in FM, so it could be an idea to have Xojo do the processing and send parts of the data in different transmissions.

FM uses UTF-8.

Because I prefer a lightweight app and wanted to see if I could manage it without a Web app :smiley:

EDIT: And in my case, the project combination is intended as an end customer solution. This way the console app can be started automatically on system boot (I fiddled around with the main loop DoEvents parameter to keep it low on CPU impact so it usually consumes as good as no cycles, except for times when there are transmissions going on) and there would be no dependency on the browser or any other app.

Ulrich I’ve been trying to get my Xojo TCPSocket to link to Filemaker but with no success. Have you a xojo example of your TCPSocket? I could not log in to your blog.

Many thanks
Que

About translations: try https://www.deepl.com/translator - I found their translations to be MUCH better than Google Translate.

When I try Ulrich’s page in either Chrome or Safari the browsers wont let me in message is ‘Domain mapping does not exist’

His adress has changed to https://xojoblog.wordpress.com

Thanks, Markus! And that’s not even the final address (but the working current one). Consider it lost in translation …