We received an email today from
Russell Watson and we like to share it with you:
For some reason in our solution some global variables were not being defined …
Where we always define 3 debugging variables ...
… for some reason only one was being defined:
What’s up?
Having first checked everywhere, that three global variables were being defined, we finally got on the track of the bug thanks to the MBS plugin syntax coloring, which was showing an ‘anomaly’ in one of the Let definitions:
Why is the first $ black?
Inspecting the DDR with a text editor which displays control characters (Textmate 2) gave us the final clue:
In the middle of the calculation, just in front of the $$ variable name there are UTF-16 BOM-characters to be found!
(A BOM is a Byte-Order-Mark which usually is only to be found at the very start of a UTF-16 text file, as can be seen when you look at a UTF-16 text file with a hex-editor, for example a DDR file:
The FF identifies the low byte and the FE identifies the high byte … thus the U+FEFF in the editor is the unicode BOM code point)
Editing the calculation to remove and re-enter the whitespace and the first $ symbol cleared the problem:
MBS Plugin happy = We’re happy !
Thank you MBS!
Thank you Christian Schmitz!
If you have stories to share, please let us know.
Since version 10.0, released in January 2020, the MBS Plugin includes a new
JSON function:
JSON.EqualContent. This function checks whether two JSON texts have equal content. This function should not be mixed up with the
JSON.Equals function, which checks if type and value are the same.
We want to compare the two functions directly. We have the values “123” as String and 123 as number. The values have the same content but different datatypes. If we write in the Script MBS( "
JSON.Equals"; "\"123\""; "123") the result is 0 and that means that the parameter are not equal as data types don't match. If we pass both values to the
JSON.EqualContent function the result would be 1, so the values are equal
MBS( "JSON.EqualContent"; "\"123\""; "123") =>
1
MBS( "JSON.Equals"; "\"123\""; "123") =>
0
We wish you much fun with this function. Let us know if you have questions about our MBS Plugin and the
JSON functions.
By Stefanie Juchmes
There are some deprecations and removals coming for the FileMaker platform and we may follow with the MBS Plugin. Currently we would like to learn who uses deprecated technologies and continues to need updated plugins from us in the future:
FileMaker Pro runtimes
Deprecated in version FileMaker 14, currently available in version 18 and probably gone for version 19.
Windows 32-bit
The number of people using 32-bit versions of Windows is falling quickly. Newer computers bought are 64-bit and come with a 64-bit Windows version. The
roadmap for FileMaker shows 32-bit support on Windows as deprecated. FileMaker 19 may drop 32-bit support for Windows as it is not listed as supported feature for the
New Claris support policy.
MacOS 32-bit
Since FileMaker version 14, FileMaker supports 64-bit on MacOS, so there hasn't been a request for a 32-bit plugin in some time.
FileMaker Cloud for AWS
The newer FileMaker Cloud 2.x does not have plugin support and the older 1.x Cloud is scheduled to have end of live at the end of calendar year 2021 (or a day later with 1st Jan 2022).
FileMaker 16 and 17
Those FileMaker versions have support end set to September 2020. See
New Claris support policy
Windows versions 7.0 and 8.0
The
New Claris support policy shows Windows 8.1 as lowest version for Windows.
If you are still interested in newer plugin versions and licenses for those items, please contact us or use this
survey. We will manage a list here for the people needing features. In future we may produce a few more versions including support for the items listed above for some time, then drop a few and eventually concentrate on the newer versions only.
We got a new example database to show how to merge PDFs. One of the feature beside adding page numbers is to build a table of contents for the document with clickable entries:
Set Variable [ $pdf ; Value: MBS("DynaPDF.New") ]
#
# create dummy page for table
Set Variable [ $r ; Value: MBS("DynaPDF.AppendPage"; $pdf) ]
Set Variable [ $r ; Value: MBS("DynaPDF.EndPage"; $pdf) ]
#
# create table for index
Set Variable [ $r ; Value: MBS("DynaPDF.SetPageCoords"; $pdf; "TopDown") ]
Set Variable [ $table ; Value: MBS("DynaPDF.Table.Create"; $pdf; 10; 2; 500; 20) ]
#
Set Variable [ $r ; Value: MBS("DynaPDF.Table.SetFont"; $table; -1; -1; "Helvetica"; 0; 1; "unicode") ]
Set Variable [ $r ; Value: MBS("DynaPDF.Table.SetFontSize"; $table; -1; -1; 14) ]
Set Variable [ $r ; Value: MBS( "DynaPDF.Table.SetColWidth"; $Table; 0; 450; 1 ) ]
Set Variable [ $r ; Value: MBS( "DynaPDF.Table.SetColWidth"; $Table; 1; 50;1 ) ]
#
# Build Table Of Contents
Go to Record/Request/Page [ First ]
Set Variable [ $destPage ; Value: 2 ]
Loop
#
# open PDF
If [ not IsEmpty ( Merge PDFs::InputPDF ) ]
Set Variable [ $r ; Value: MBS("DynaPDF.OpenPDFFromContainer"; $pdf; Merge PDFs::InputPDF) ]
If [ MBS("IsError") ]
Show Custom Dialog [ "Failed to open PDF." ; $r ]
Exit Script [ Text Result: ]
End If
Else If [ not IsEmpty ( Merge PDFs::InputPath ) ]
Set Variable [ $r ; Value: MBS("DynaPDF.OpenPDFFromFile"; $pdf; Merge PDFs::InputPath) ]
If [ MBS("IsError") ]
Show Custom Dialog [ "Failed to open PDF." ; $r ]
Exit Script [ Text Result: ]
End If
Else
# no PDF?
End If
#
# check if we have pages to import
Set Variable [ $pageCount ; Value: MBS( "DynaPDF.GetImportPageCount"; $PDF ) ]
If [ $pageCount > 0 ]
Set Variable [ $lastPage ; Value: MBS("DynaPDF.ImportPDFFile"; $pdf; $destpage) ]
If [ GetAsNumber($lastPage) >0 ]
#
# put in a named destination for this new page
Set Variable [ $NamedDest ; Value: "Record" & Get(RecordID) ]
Set Variable [ $NamedDestHandle ; Value: MBS( "DynaPDF.CreateNamedDest"; $PDF; $NamedDest; $DestPage; "Fit") ]
# add table entry
Set Variable [ $rowNum ; Value: MBS("DynaPDF.Table.AddRow"; $table) ]
Set Variable [ $r ; Value: MBS("DynaPDF.Table.SetCellText"; $table; $rowNum; 0; "left"; "top"; Merge PDFs::InputName) ]
Set Variable [ $r ; Value: MBS("DynaPDF.Table.SetCellText"; $table; $rowNum; 1; "right"; "top"; $destPage) ]
# add click action
Set Variable [ $Action ; Value: MBS( "DynaPDF.CreateGoToActionEx"; $PDF; $NamedDestHandle) ]
Set Variable [ $r ; Value: MBS( "DynaPDF.Table.SetCellAction"; $Table; $rowNum; 0; $action; "Invert" ) ]
Set Variable [ $r ; Value: MBS( "DynaPDF.Table.SetCellAction"; $Table; $rowNum; 1; $action; "Invert" ) ]
#
Set Variable [ $destPage ; Value: $lastPage + 1 ]
End If
End If
#
# optionally close import files
Set Variable [ $r ; Value: MBS("DynaPDF.CloseImportFile"; $pdf) ]
#
# next file
Go to Record/Request/Page [ Next ; Exit after last: On ]
End Loop
#
# Draw Table
Set Variable [ $r ; Value: MBS("DynaPDF.EditPage"; $pdf; 1) ]
Set Variable [ $r ; Value: MBS("DynaPDF.Table.Draw"; $table; 50; 50; 742) ]
Set Variable [ $r ; Value: MBS("DynaPDF.EndPage"; $pdf) ]
#
# show final PDF
Set Field [ Merge PDFs::FinalPDF ; MBS("DynaPDF.Save"; $pdf; "Merged.pdf") ]
Set Variable [ $r ; Value: MBS("DynaPDF.Release"; $pdf) ]
The example file will be included in the next plugin prerelease. Please do not hesitate to contact us with questions.
New in this prerelease of version 10.1 of the MBS FileMaker Plugin:
Download at
monkeybreadsoftware.de/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder.
Bis heute gilt der Frühbuchertarif zur elften deutschsprachigen
FileMaker Konferenz 2020 in Malbun (Liechtenstein), vom
17. bis 20. Juni 2020 28. bis 31. Oktober 17. bis 19. Juni 2021 22. bis 24. Juli 2021 . Wer noch nicht angemeldet ist, sollte eventuell heute buchen und ein Hotelzimmer reservieren. Aktuell gibt es nur noch ein paar freie Zimmer in Malbun und wer die verpasst, müsste weite weg übernachten und morgens zur Konferenz per Auto oder Bus fahren.
Die Veranstalter vom Verein FM Konferenz erwarten auch 2020 rund 120 Entwickler, Anwender, IT-Fachleute und Entscheidungsträger aus Wirtschaft, Bildung und Verwaltung. Rund um über 20 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. Lernen Sie was es neues gibt, nehmen Sie Impulse mit für die eigene Arbeit und erfahren Sie mehr zu FileMaker von deutschsprachigen Experten!
Die
MBS Plugin Schulung vorher findet am
17. Juni 2020 16. Juni 2021 21. Juli 2021 statt (im gleichen Hotel).
Bitte planen Sie wenigstens einen extra Tag ein für ihren Besuch in Liechtenstein, damit Sie die Natur in dem schönen Tal geniessen können. Den Aufstieg auf den Sareis können Sie bequem zu Fuß vom Hotel aus starten und die Turnastraße hinauf spazieren bis zum Restaurant am Gipfel. Oder alternativ die Seilbahn nehmen.
Interesse an mehr? Die
Claris Engage Europe 2020 vom 26. bis 28. Oktober 2020 bietet deutlich mehr Vorträge, mehr internationale Teilnehmer und vor allem FileMaker Mitarbeiter aus den USA, die gerne mal einen Blick unter die Haube von FileMaker bieten.
Monkeybread Software signed up as a conference sponsor for the upcoming Claris Engage conference in Nashville, USA.
Details for the conference including the new website should be online early March, but please mark the dates in the calendar and keep the week available. Check out the
Gaylord Opryland Resort & Convention Center website today.
Claris International Inc. hosts the Claris Engage conference in Nashville, August 3-6 2020.
We will attend and have a booth as usual, so see you there!
New in this prerelease of version 10.1 of the MBS FileMaker Plugin:
Download at
monkeybreadsoftware.de/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder.
To improve the balance between work and live, some simple things can help:
First, it's a great idea to set a rule in the household to have no phones for meals. So I just leave my iPhone in the office, so it doesn't grab my attention. Some families have baskets for the phones so when you enter kitchen, you put it there. We'll see if we do this when our children get older and we get more devices.
Next figure out the time you allow others to disturb you. The default setting for iOS is to be silent between 22:00 at night and 7:00 o'clock in the morning. Now it seems to work better for me to move those times to 20:00 and 9:00 o'clock. In the morning I may get up long before 9, but to get ready, have breakfast and read through emails, it may be 9 when I am ready to take calls.
For the evening it's difficult alone to get away from work and not work till midnight, but at least the iPhone won't disturb me when I am busy doing some focused work, or watch a movie with my family.
What do you do to get some rest from screens?
Today a client asked how to automate login to the admin console when it is open in a web viewer within a FileMaker solution. You probably saw the video
Automate web viewer already?
The login here is a bit more difficult as you need a couple of JavaScript calls to login, but here is a script that works for us:
Set Variable [ $JS ; Value: "
function SendEvent(o, name)
{
// send event to JavaScript event listeners¶
var evt = document.createEvent('Events');
evt.initEvent(name, true, true);
o.dispatchEvent(evt);
}
// set user name¶
o = document.getElementById('inputUserName');
o.focus();
o.value = '" & Admin Console::Username & "';
SendEvent(o, 'input');
SendEvent(o, 'blur');
// set password¶
o = document.getElementById('inputPassword');
o.focus();
o.value = '" & Admin Console::Password & "';
SendEvent(o, 'input');
SendEvent(o, 'blur');
document.getElementById('LOGN_Butn_SignIn').click();" ]
Set Variable [ $r ; Value: MBS("WebView.RunJavaScript"; "web"; Substitute ( $JS; ¶; Char(10) )) ]
As you see we define an utility function in JavaScript to trigger an event programmatically. This is required as the login form has event listeners in JavaScript which validate the fields and we need those to enable the Sign In button for us. we do the following steps for each field. We query the field by its ID, set the focus, enter the text and trigger input event to have the JavaScript recognize the changes and then blur it to remove focus. Finally on the end we trigger a click on the login button.
Please note that for text in a formula FileMaker removes the line breaks, so for each comment we add a ¶ character to indicate we want a line break there. Also we do a replace all here to change line endings to unix line endings before we run it with the
WebView.RunJavaScript function.
If you have questions, please don't hesitate to contact us. The example will be included with next plugin version.
When we implemented
CLGeocoder functions in year 2014, there was not much JSON in use. Nowadays a lot of FileMaker developers deal with JSON data, so why not add more
JSON functions to MBS Plugin?
We got a refreshment for our
CLGeocoder functions today. For next plugin we first add a wait parameter to
CLGeocoder.GeocodeAddressString and
CLGeocoder.ReverseGeocodeLocation functions. If wait is 1, the plugin waits a bit until the geocoder is done. Just convenient to avoid having the loop to wait in FileMaker scripts.
Second, we add a
CLGeocoder.JSON function to return the data as JSON. This is one big JSON which encodes all the details including status variables, error details and the list of place marks found. For each place mark you get the location, region and address properties.
We can now query address in one Let statement, check status and return the result as JSON:
Let ( [
Address = "Berlin, Germany";
// run query and wait a bit
g = MBS( "CLGeocoder.GeocodeAddressString"; Address; 1 );
e = MBS("IsError");
// query JSON if we got something
r = If (e = 0; MBS( "CLGeocoder.JSON"; g ); g);
// free resources
f = If (e = 0; MBS( "CLGeocoder.Close"; g ); 0)
]; r )
Similar let statement for the other way around:
Let ( [
latitude = 52.517631899999998;
longitude = 13.4096574;
// run query and wait a bit
g = MBS( "CLGeocoder.ReverseGeocodeLocation"; latitude; longitude; 1 );
e = MBS("IsError");
// query JSON if we got something
r = If (e = 0; MBS( "CLGeocoder.JSON"; g ); g);
// free resources
f = If (e = 0; MBS( "CLGeocoder.Close"; g ); 0)
]; r )
We add this for next release for your convenience. Please do not hesitate to contact us in case of questions.
New in this prerelease of version 10.1 of the MBS FileMaker Plugin:
- Added parameters for CNContactPicker.Show to set position.
- Removed check from ImageCapture.RequestScan to check for open session.
- Changed DynaPDF.Initialize to accept Starter, Lite, Pro and Enterprise texts for demo modes again.
- Changed Socket.NewTCPSocket to mark sockets to accept IPv4 connections on IPv6 sockets.
- Added checkbox for preferences to turn font changes on/off.
- For DynaPDF we will rename the DLL to have 64-bit library named dynapdf.dll in future and dynapdf32.dll for the 32-bit version.
- Updated DynaPDF to version 4.0.37.104.
- Fixed issue with FM.RunDatabaseDesignReport to work in MacOS Catalina. Needs accessibility permissions in system preferences to click save button.
Download at
monkeybreadsoftware.de/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder.
Here is a list of which FileMaker version includes which CURL version:
FileMaker version | CURL Version |
11.0.4 | 7.19.4 |
12.0.5 | 7.21.6 |
13.0.9 | 7.21.6 |
14.0.4 | 7.38.0 |
15.0.3 | 7.44.0 |
16.0.4 | 7.51.0 |
17.0.3 | 7.58.0 |
18.0.3 | 7.62.0 |
You can learn about CURL releases on the
curl website.
Why do we care? Well, if you still use FileMaker before version 16, your FileMaker scripts using Insert From URL are affected by the TLS certificate bugs in older CURL versions. And if certificate verification is not done right, someone can attack your queries, gain your password or provide invalid data to your solution. So please keep FileMaker up to date!
As with MBS Plugin, Claris Inc. also regularly updates the open source libraries used. Usually you do that on the begin of the development cycle, so you have time to find and issues from the newer library version like a bug fix, which changes behavior in a way you didn't intent. e.g. we run into
CURL change for email download via IMAP.
MBS Plugin 10.1 will include CURL version 7.68.0 and MBS Plugin 10.0 shipped with version 7.67.0.
PS:
Updated blog post here.
Yesterday Sean Beach, one of our clients in New York emailed me back about our JavaScript integration. To quote him:
"Wanted to follow back and say that this plugin is a game changer for my showcontrol product. Thanks so much!”
The discussion was about our
JavaScript functions and a couple of his questions got answered in our
Tips for our JavaScript functions blog post:
"This document is fantastic, and actually answers most of my questions from the previous email."
We are delighted about the feedback we got!
The same day
Stefanie got two of her latest articles published about using JavaScript to calculate distances.
On our
FileMaker blog the version using our FileMaker Plugin:
FileMaker and JavaScript - the perfect combination
And even on the official
Xojo blog an article about our Xojo class to run JavaScript:
Xojo and JavaScript – A Perfect Combination
We are happy to see that our JavaScript integration is so well received by clients from around the world. And it just started with a hint from one user in early December to take a look into this topic.
Check out the
JavaScriptEngineMBS class for Xojo and the
JavaScript functions for FileMaker!
This year in April our company will turn 20 years old.
We'll plan to have a big party here in Germany near our office with over 100 guests.
Today we send invitations to guests who have not yet responded.
If you like to join and you miss an invitation, you can contact us and ask whether your invitation got lost.
As people confirm they are coming, we'll add them to the guest list. If we run out of space, we may put people on the wait list.
If you can't make it, please respond soon, so we don't need to contact you again later.
New in this prerelease of version 10.1 of the MBS FileMaker Plugin:
Download at
monkeybreadsoftware.de/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder.
In the newest version of the MBS FileMaker Plugin 10.0 we offer functions for the use of JavaScript without the use of a web viewer. See WebView.RunJavaScript and WebView.Evaluate to run or evaluate JavaScript in a web viewer. The new JavaScript functions increase your functionality in FileMaker enormously. You can write your own Javascript, use a JavaScript snipped that fix a problem or fast up a process of your solution. In this article I want to show you how to use JavaScript code in FileMaker: Setting values in the JavaScript with functions in FileMaker, add functions and run them.
If you have a problem that you want to solve, you don't have to reinvent the wheel again and again. Perhaps someone has already found a solution to this problem and shared his solution on the Internet. So start a search engine and try your luck. Special thanks to André Rinas and his website andrerinas.de that supply very useful JavaScript snippets to everyone. This example is based on one of this JavaScript codes.
(more)
Der nächste FileMaker Stammtisch in Rhein-Main findet diese Woche am Donnerstag, den 6. Februar 2020 in Hofheim-Wallau statt.
ca. 19 bis 23 Uhr im Ristorante BELLA BARI - Hessenstraße 1 - 65719 Wallau.
Themen diesmal FileMaker Konferenzen in 2020 und gerne auch Fragen an mich zum MBS FileMaker Plugin 10.0.
Gerne könnt ihr eure FileMaker Lösungen mitbringen und bei Probleme und Fragen direkt vorführen. Eventuell hat jemand in der Runde ja eine Lösung für euch.
siehe
Denkform Webseite
Zur
MBS Plugin Schulung am 7. Mai 2020 sind noch Plätze frei und die Frühbucherrabatt für die
FileMaker Konferenz endet am 20. Februar 2020.
Here a few tips we recently learnt for our JavaScript engine based on
Duktape in the
MBS Plugins for FileMaker and
Xojo:
- Use performance.now() to get time within JavaScript and measure how long something takes. Here an example where we measure how many milli seconds it takes to run a loop one million times:
function testFunction() {
for (var i = 0; i < 1e6; i++) {}
}
var t1 = performance.now();
testFunction();
var t2 = performance.now();
Print('test took: ' + (t2 - t1) + ' milliseconds');
- All global functions and properties in JavaScript are attached to the global object. You can access them explicitly via globalThis keyword.
- List global properties via JavaScript:
Var list = Object.keys(globalThis);
The list will include all global names including functions like Print registered by MBS Plugin.
- Check Duktape.version for the version number. If we update the engine, you can check the version number and compare. Currently the value is 20500 for version 2.5.
- Use unicode escapes in strings if needed to mask special characters. While the engine handles UTF-8 fine, you can escape some characters with \u followed with a hex 4 digit number, e.g.
n = '\u0041';
Which will assign "A" to variable n.
- Use built-in functions to encode text as hex or base64 via Duktape.enc:
Duktape.enc('base64', 'Hello')
This returns "SGVsbG8=".
- Use Duktape.dec and TextDecoder class to decode base64/hex encoded text to UTF-8 string:
var result = new TextDecoder().decode(Duktape.dec('base64', 'Zm9v'));
Result is now a variable with text "foo".
- Access call stack with Duktape.act function. Query Duktape.act(i) with various values of i. Pass -1 for the act() call, -2 for the current function and -3 for the caller of current function.
The returned object contains properties for lineNumber and function. When you query function.name, you get the name of the function.
- Add console object if needed. You can add a console object and include a log function, which sends arguments to a Print function:
console = { log: function() { Print(Array.prototype.join.call(arguments, ' ')); } };
- Provide environment some JavaScript may need. If some JavaScript expects a global window object to store something, you can simply create a dummy one:
window = {};
This may not provide functionality, but allows at least code to check for this to work.
- Prefer functions over evaluating code. Code in functions is parsed and uses registers for the virtual machine, while code evaluated may use named variables, so if you can put your code in a function and just evaluate the function call, things may execute a bit faster.
- Be aware all numbers in JavaScript are doubles. Evaluate "9999999999999999" and you get "10000000000000000" back. Comparing numbers may not give the result you expect as "0.1+0.2==0.3" evaluates to false.
If you have questions, please do not hesitate to contact us.
See also
JS.Evaluate and related
JavaScript functions in
MBS FileMaker Plugin and
JavaScriptEngineMBS class in
MBS Xojo Plugins.
Who tried the
MBS Plugin 10.1pr1 and changed the font size via preferences dialog?
Let us know your experience. Does it help? What is your favorite font and size?
See
A font preference for FileMaker and
Using a different font in FileMaker