FileMaker records to XML or JSON

Sometimes you need to query FileMaker records as XML or JSON data and include related records. This can be tricky to do in pure FileMaker scripts and calculations, but via MBS FileMaker Plugin we can provide help. Our FM.SQL.Execute function can use SQL to fetch records. The FM.SQL.CSV, FM.SQL.JSONRecord and FM.SQL.JSONRecords functions can help to pack those in comma/tab separated text or JSON. New for next plugin version are FM.SQL.XMLRecord and FM.SQL.XMLRecords functions to do for XML what we had for JSON already. 


Below we have a sample script to use FM.SQL.XMLRecords to get records from two tables and insert the related records in the right position in the XML with our XML.SetPathXML function.


# SQL XML in file Contacts


# Run query to fetch some records

Set Variable [ $sql1 ; Value: MBS( "FM.SQL.Execute"; ""; "SELECT \"PrimaryKey\", \"First Name\", \"Last Name\", \"Company\", \"Title\" FROM Contacts") ] 

# get them as XML

Set Variable [ $xml ; Value: MBS( "FM.SQL.XMLRecords"; $sql1; "people"; "person"; "ID¶First¶Last¶Company¶Title"; 2+1) ] 

# 

# loop over records to look for related record

Set Variable [ $count ; Value: MBS( "FM.SQL.RowCount"; $sql1 ) ] 

Set Variable [ $index ; Value: 0 ] 

If [ $index ≤ $count ] 

Loop

# get primary key from result

Set Variable [ $key ; Value: MBS( "FM.SQL.Field"; $sql1; $index; 0 ) ] 

# Run query for related records

Set Variable [ $sql2 ; Value: MBS( "FM.SQL.Execute"; ""; "SELECT Type, Number FROM \"Phone Numbers\" WHERE ForeignKey = ?"; $key) ] 

# get them as XML

Set Variable [ $xml2 ; Value: MBS( "FM.SQL.XMLRecords"; $sql2; "phones"; "phone"; "Type¶Number"; 2+1) ] 

# Now insert them in the person node as new child phones

Set Variable [ $xml ; Value: MBS( "XML.SetPathXML"; $xml; "people.person[" & $index &"].phones"; 0; $xml2 ) ] 

# don't forget to release memory

Set Variable [ $r ; Value: MBS( "FM.SQL.Release"; $sql2) ] 

# 

# next

Set Variable [ $index ; Value: $index + 1 ] 

Exit Loop If [ $index ≥ $count ] 

End Loop

End If

# 

# don't forget to release memory

Set Variable [ $r ; Value: MBS( "FM.SQL.Release"; $sql1) ] 

# Output the XML with format & color

Set Field [ Contacts::XML ; MBS("XML.Colorize"; MBS("XML.Format"; $xml)) ] 


We hope this helps people interested in XML exports. Same technique can be used with our JSON functions to build similar JSON structures.


PS: Script text copied with color using our copy button in Script Workspace.


Using WolfSSL and custom CURL functions

The fine people at WolfSSL have a few impressive products around SSL, Encryption and SSH with an emphasis on the performance and on a small footprint. Since CURL already offers multiple SSL backends, we could build our plugins using wolfSSL.

CURL is doing well and we are using it now for over 10 years in our plugins for various tasks including HTTP, FTP, SFTP and email via IMAP or SMTP protocols. See the state of CURL video where Daniel explains the progress.

Compared to the OpenSSL library we use currently for most things, wolfSSL has a lot to offer:
  • If you are concerned about memory usage, check wolfSSL as it uses less memory.
  • When you need a cross platform SSL library, it offers latest TLS 1.3 with DTLS 1.2.
  • They include hardware support for encryption, so if you have acceleration hardware in your computer, they can use it.
  • While wolfSSL has its own interface, they also have a compatibility interface matching OpenSSL, so a transition would be easy.
  • You may benefit from additional progressive ciphers such as ChaCha20, Curve25519, NTRU, and Blake2b.
  • wolfSSL can be used for free with the GPL license option or used with commercial license and they offer paid support.
If you have a need for use of wolfSSL, please let us know. We can offer to use CURL functions using wolfSSL as SLL backend for your projects in Xojo and FileMaker.

Together with wolfSSL, we can offer customization to CURL library itself. We corodinate with Daniel Stenberg from wolfSSL to get changes made for you in CURL and then integrate those into our plugin functionality to get you the features you need the most.

See also wolfSSL vs. OpenSSL and CURL at wolfSSL.

Please contact us if you are interested in some special CURL modifications or use of wolfSSL and related products in FileMaker or Xojo.

Using Sharing Services in MacOS with FileMaker

With next MBS FileMaker Plugin (already in 10.3pr7 to try), you are able to trigger the sharing services in macOS from FileMaker. You can pass images, URLs, styled text and native file paths to various services. Not just one value, but several, e.g.

  • Send text and image to Messages
  • Send files, text, images, URLs, subject and recipients to Apple Mail
  • Send pictures to Photos application
  • Send text and URLs to reminders or notes applications
  • Send files via AirDrop to other users
  • Send URLs to reader list in Safari
  • Send PDF to Books application
  • Send picture to make it the desktop background

More services are available, for example when you install other applications.

(more)

Xojo like properties with parameters in C++

Xojo has a very unique feature: the assigns keyword. You use it to have two methods (getter and setter) with parameters work like a property. e.g. in the dictionary, you have those methods:

Value(Key as Variant) as Variant

and

Value(Key as Variant, assigns Value as Variant)

The first is a normal method returning the result. But the second one has an extra parameter, which is then filled with an assign operation. You write something like d.value(1) = 2, where the 2 is internally put as a parameter and internally calls Value(1,2).

To replicate this in C++, we got a way to replicate this by using a temporary object and two blocks for getter and setter. So the value() function in C++ returns the IntPropertyAssign object, which knows how to get or set the value. Then we can either assign a value, which calls to the operator= and calls setter. If you query the value, it calls through to the getter. (more)

Inside Delegates

You may have used a delegate in Xojo before. Technically a delegate is an object encapsulating a function pointer and if needed a reference to the object reference for a non-global method. As delegates are objects, you can store delegates in a dictionary or array and reference them later by name or index.

Although delegates are objects and they point to a class definition for a "Delegate" class, there is no such class known to the Xojo compiler. You can't use isA with Delegate or extend Delegate via extends or a plugin class extension. The only way to detect if an object or variant is a delegate object is to use introspection and check the full name there:

Dim aDelegate As ADelegate = AddressOf someFunction
Dim i As Introspection.TypeInfo = Introspection.GetType(aDelegate)

When you create a delegate, Xojo allocates an object for you. If you pass in a global method, it just reference the function pointer. But for a method from an object, the object is also referenced. Such a reference may be weak if you use weakAddressOf operator in Xojo. There is no built-in way to get the weak status or the target object, but there are feedback cases and we may be able to do something via plugin.

If you assign the delegate to the Ptr, you get the internal function pointer. This pointer doesn't point to the object, but to the actual Xojo function to be called through the Invoke method. If you assign one delegate to another delegate, that will work as long as the parameters are the same for both types.

We'd love to see Xojo Inc. add some properties to the Delegate class like "Target as Object", where you can see the target object. For weak delegates, a weak property may be great to see the status. And of course the target should become nil if the weak reference got invalid. Currently we can only handle that with catching NilObjectException when invoking them and then set delegate to nil to clear it. More great properties may be the parameters as string as well as a the delegate name itself.

To mitigate the issue for us, we add three functions GetDelegateParametersMBS, GetDelegateTargetMBS and GetDelegateWeakMBS. All take a variant with a delegate. They check whether this may be a delegate and if those, return you the parameter string, the target object or the weak flag. They do work in current and older Xojo version on macOS, Windows and Linux as we see, but may break with a future Xojo update. For weak references, the target is nil when the reference is broken.

See also a few feedback cases worth to support:
20844: Show more delegate information in the debugger
23305: Let Delegates to have properties to retrieve its content
26060: Detect weak status of a weak delegate

Firebug as Web Inspector for FileMaker on Windows

Did you know the old Firebug (ceased in 2017) can still be used in a web viewer in FileMaker on Windows?

We got it to work here for some development:



Allows to open a console, do some inspection in DOM tree and CSS rules. It even allows you to select object in the html page with mouse to inspect. And can optionally run in a separate window.

But sadly it is long outdated, so may not know latest JavaScript tricks or have some bugs. And doesn't work with more than 1x resolution of screen as far as I see. But otherwise may be a help here to debug JavaScript with IE 11 within FileMaker's web viewer. For installation in FileMaker, you can run the JavaScript to initialize via WebView.RunJavaScript via our plugin.

Vier Monate bis zur Deutschen FileMaker Konferenz 2020 in Malbun

Noch vier Monate bis zur FileMaker Konferenz 2020 in Malbun (Liechtenstein).

Vom 28. bis 31. Oktober 17. bis 19. Juni 2021 22. bis 24. Juli 2021 findet die elfte deutschsprachige FileMaker Konferenz im JUFA Hotel in Malbun, Liechtenstein statt. Ursprünglich geplant für Juni muss die Veranstaltung leider in den Oktober verschoben werden. Wir hoffen dennoch auf tolles Wetter, viele Interessante Teilnehmer und Gespräche. Eventuell könnte das die einzige Konferenz rund um FileMaker in diesem Jahr werden, die vor Ort stattfindet.

Ein MBS Schulungstag ist für den Mittwoch vorher geplant. Bei Interesse kann man sich gerne bei uns anmelden. Die Ankündigung liegt hier: MBS Workshop



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!
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.

MBS FileMaker Plugin, version 10.3pr7

New in this prerelease of version 10.3 of the MBS FileMaker Plugin:
  • MBS FileMaker Plugin compiles for Apple Silicon, so we are ready.
  • Added Hex and Base64 as text encodings, so lots of functions can take those and decode/encode automatically.
  • Rewrote Font.Activate and Font.Deactivate for newer macOS versions.
  • Changed stored license handling for iOS to now show expired dialog when an old license is stored in preferences file.
  • Added script name comment to copied scripts.
Download at monkeybreadsoftware.com/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder.

MBS Xojo Plugins, version 20.3pr7

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

FileMaker Magazin - MBS Artikel

Wir haben die Artikel zum MBS Plugin aus dem FileMaker Magazin gesammelt hier online gestellt: FileMaker Magazin Artikel.

Mehr Artikel gibts im FMM Premium Abo mit Beispiel Downloads, FMM Wissensdatenbank & Zugriff auf alle Ausgaben seit 1994!

Das FileMaker Magazin ist eine exzellente Quelle von Informationen, Anleitungen und Profitips.


Windows Photos Acquire

For next MBS Xojo Plugins we add classes for Windows Photos Acquire API on Windows 7 and newer. Our new WinPhotoAcquireMBS class lets you open a source and acquire the pictures from it, e.g. import from digital camera to local folder.

Please use WinPhotoAcquireDeviceSelectionDialogMBS class to ask the user to pick a device. That may be a WIA, STI, File System, WPD, STI or TWAIN device as long as Windows has drivers for it. The dialog looks like the screenshot on the right.



Next you can use WinPhotoAcquireOptionsDialogMBS class to show the dialog to do settings. The user may just pick settings and save them for next time. There is also WinPhotoAcquireSettingsMBS class to manually configure them and define some parameters like the file name template.



The source may provide pictures dynamically without importing via WinPhotoAcquireSourceMBS class. Check there for the items() and inspect them. Each WinPhotoAcquireItemMBS object may give you the name, thumbnail and you can request the data.

You can acquire pictures with or without progress dialog. If you request without dialog, you can still use WinPhotoProgressDialogMBS class to show progress. Via WinPhotoAcquireProgressCallBackMBS you receive updates from Acquire method on how processing is going, e.g. when a transfer starts, ends and how the progress is made. You can return true in Cancelled event to cancel it at any time.

Those new classes accomplish the ImageCapture class for MacOS and the WIA classes for Windows to access cameras and scanners.

MBS Workshop in Malbun bei der FileMaker Konferenz

In Zusammenarbeit mit dem Verein FM Konferenz bieten wir eine Schulung zum MBS Plugin an. Am 28. Oktober 2020 16. Juni 2021 21. Juli 2021 können Sie in Malbun, Liechtenstein an einer eintägigen Schulung teilnehmen. Lernen Sie die über 6000 Funktionen einmal näher kennen und wie Sie sie effektiv einsetzen. Sammeln Sie Ideen und verbessern Sie ihre FileMaker Lösungen durch den Einsatz unseres Plugins.

Das Monkeybread Software Plugin für FileMaker stellt eine vielseitige Erweiterung der eigenen Datenbank dar. Der Kurs bietet nicht nur einen tiefgreifenden Überblick in die Benutzung und Entwicklung, sondern bietet auch die Chance das Plugin günstiger zu erstehen.
  • Einführung in das MBS Plugin
  • Überblick über die Funktionsbereiche
  • Neues im MBS Plugin dieses Jahr und in der dann aktuellen Version
  • Rundgang durch ausgewählte Beispiele
  • Gemeinsames Implementieren von Plugin Funktionen in eine Datenbank.
    • Upload/Download mit CURL auf einen HTTP/FTP Server
    • Ausfüllen eines Formulars auf einer Webseite
    • Bilder bearbeiten
    • PDF Verarbeitung
    • Druckerfunktionen
    • Barcodes und Zahlungsscheine
    • Einbinden von Webservices with JSON/XML für REST/SOAP.
    • Senden und Empfangen von Emails.
  • Fragen und Antworten
Die Teilnahme kostet 200 CHF inkl. Verpflegung und MWSt.. Trainer ist der Plugin Entwickler und Monkeybread Software Geschäftsführer Christian Schmitz persönlich. Beginn gegen 9 Uhr und Ende gegen 16 Uhr.

Anmeldung bei Monkeybread Software.

Am Abend vorher treffen wir uns zum gemütlichen Beisammensein im Restaurant vom Konferenzhotel. Im Anschluss an die Schulung können Sie gleich rüber zum Apero gehen und die anderen Teilnehmer kennen lernen. Wegen Covid-19 besteht die Möglichkeit, dass Veranstaltungen ausfallen müssen. Das wird sich eventuell erst kurzfristig entscheiden. Aktuell ist Liechtenstein Covid-19 frei und die Grenzen sind offen. Wir bitten um baldige Anmeldung und können für unsere Schulungen eine kostenlose Stornierung anbieten.

Bei Fragen und Themenwünschen melden Sie sich bitte direkt bei uns.

MBS Xojo Plugins, version 20.3pr6

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

MBS FileMaker Plugin, version 10.3pr6

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

MBS and OmegaBundle 2020

This year two MBS Products are included with OmegaBundle:
Let us explain a bit the small print. The bundle is mainly for new users coming to the platform to give them a kick start with various tools available. But we know a lot of existing customers may be interested to get a license.



For ChartDirector, you get a new license with one year of updates. If you have a ChartDirector license, we can extend your license for another year.
With ChartDirector you can charts for desktop, console and web applications. The charts can be changed and animated if needed. You can check our examples to handle mouse clicks on them and you can output charts as picture, PDF or SVG files.

For DynaPDF you get a new Starter license. If you have an expired starter license already, we renew the license with a new year. If you have a higher level of license, we contact you to whether you want to order the update for your license with a discount.

For this year we also offer discounted upgrades from the OmegaBundle to DynaPDF Lite versions. Special price for Lite upgrade is $129 USD plus tax (or similar in other currency). You can get the Pro or Enterprise upgrade in addition for regular pricing.

If you are interested in an upgrade, please contact us. You first buy OmegaBundle and then we can bill you any difference needed to reach the items you like to get. And of course that bill could include our other plugins.

Apple Silicon

We watched the Apple WWDC keynote. From all the announcements Apple made, the one causing the most work for us, will be the transition to Apple Silicon, their own CPUs based on the ARM 64-bit design.

As the rumors were around, we expected that to come and look forward to see what they can do. We started already and got Xcode 12 beta and built our plugins for ARM. It works mostly and a few little adjustments are needed. Currently it doesn't link yet as libraries are still in need to be rebuild. We started to build various libraries and I can say zlib, openssl, curl, sqlite, png and others build just fine.

Building them doesn't mean everything will work, so we have to wait for a test device to show up here. But that may happen in the next weeks.

We will be ready when the first devices go to public and Claris or Xojo ship their updated applications to use with our plugins.

But such a change reiterates how important it is to work with supported applications, where some developer takes care and provides regularly updates. In the last 5 years, a lot of clients came back to ask for 64-bit versions for MacOS, Windows and Linux as all operation systems moved to 64-bit. Now quite a few will come back to ask for ARM versions later this year.

Update: It's Friday, 26th June and I am done. All plugins for Xojo and FileMaker build for Apple Silicon. Once the test Mac arrives, we can try them.

Search shortcut for Script Workspace

For MBS FileMaker Plugin 10.3 we added a new shortcut with Command-Shift-F to jump focus in the search field for the script list in the Claris FileMaker Pro Script Workspace.

In Script Workspace:
⌘ ⇧ F to set focus to script list search.
⌘ Fto set focus to search field for current script.
⌘ + zooms in.
⌘ -zooms out.
⌘ =zooms to 100%.

In Data Viewer with focus on the list (blue line around):
⌘ Fshows find bar.
⌘ Ggoes to next found text.
⌘ ⌥ F to show/hide fields.
⌘ ⌥ G to show/hide global variables.
⌘ + zooms in.
⌘ -zooms out.
⌘ =zooms to 100%.
⌘ ⌥ Ccopy text in the list.

In text areas like custom function editor:
⌘ Rshows rulers.
⌘ Ishows invisible characters
⌘ Fshows find bar.
⌘ Ggoes to next found text.
⌘ ⌥ Ccopies styled text.

In a list showing in the FileMaker, e.g. list of fields:
⌘ Ccopies content.
⌘ Fshows find bar.
⌘ Ggoes to next found text.
⌘ + zooms in.
⌘ -zooms out.
⌘ =zooms to 100%.

In relationship dialog:
⌘ Fsets focus to search field.

Please enjoy and if you have questions, please don't hesitate to contact us.

Ten months till Xojo.Connect 2021 in London

Just ten months till the XDC 2021 in London, England. Tickets are still available for $650 USD till 30th June 2020 instead of $950 later.

This conference was cancelled due to new rules for quarantine when entering the United Kingdom.


It will be held April 21-23, 2021 March 30-April 1st, 2022 in London, England at the Holiday Inn Bloomsbury. This conferences is the best place to meet Xojo developers from around the world in real live, make contacts, present yourself as expert and learn what is new in Xojo. Tickets are available in the Xojo store and if you bring your partner, you can order an extra guest ticket for the dinner events.

Check out the conference highlights video if you want to see what it's like - or ask one of the many attendees from the forum!

Wether you are full or part time Xojo developer, this is your chance to learn all about the Web 2.0 framework, the Android progress and what's new in the Xojo world.

To get there, please use public transportation. The piccadilly line brings you right from Heathrow Airport to Russell Square Station, just next to the hotel. That trip should cost about 3 £ and you may just pay by tap in/out with your NFC enabled credit card or phone. Otherwise buy an Oyster card and load money on it if you don't have such a card. If you come by Eurostar train through the tunnel from France, you can exit Pancras station and just walk to the hotel. Otherwise take one station via subway to Russell Square Station. That station is right behind the hotel block.

See you soon there!

MBS Xojo Plugins, version 20.3pr5

New in this prerelease of the 20.3 plugins:
  • Added WindowsGraphicsDeviceContextMBS class.
  • Added SDAVAssetExportSessionMBS class.
  • Added SHA3_224, SHA3_256, SHA3_384 and SHA3_512 to DigestMBS class.
  • Updated to Xcode 11.5.
  • Added MIMEType property to WKWebViewMBS class.
  • Added WKNavigationMBS class to track navigations for WebKit 2.x.
  • Added CurrentNavigation as WKNavigationMBS property for WKWebViewControlMBS control.
  • Added Navigation parameter for didFailProvisionalNavigation, didFailNavigation, didCommitNavigation, didStartProvisionalNavigation, didReceiveServerRedirectForProvisionalNavigation and didFinishNavigation events.
  • Fixed edge case with month wrap in DateDifferenceMBS class.
  • Updated LCMS to version 2.11.
  • Added performWindowDragWithEvent method to NSWindowMBS class.
  • Deprecated Addressbook classes in favor of Contacts classes.
Download: monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.

MBS FileMaker Plugin, version 10.3pr5

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

Moved to macOS Catalina

Finally we moved to macOS Catalina just before the next version is announced on Monday at WWDC. On the way there a few apps stopped working like the older Real Studio and FileMaker versions. DragThing didn't make to the new OS and for some old buddies like Fetch, we got updates.

The old Xcode 9.4 doesn't work any more, so that may be the end of the 32-bit Mac plugin for FileMaker here. You can still get version 10.2 from us in 32-bit if needed, e.g. you still have FileMaker 13 and need to use the plugin to push data as JSON e.g. to the DATA API in newer FileMaker servers.

For Xojo the 32-bit Mac compilation via command line still works, so we can keep that a bit longer, but can't test anymore here without a VM. We now build 32-bit and 64-bit MacOS plugin via command line using Xcode 11.5.

One thing we had to adjust a lot of file paths is that, we can't put a folder any more on root folder of the start volume. The disk now has internally two partitions with a read only one for the system and a writable with my data. Great to protect me against applications trying to hack into the system. But inconvenient as I had to move my build system to move a folder in my user folder.

As the new MacOS version is upcoming, we will mark a couple of classes/functions as deprecated, e.g. Addressbook functions. Please move to newer Contacts functions as we are not sure whether Apple will keep the older APIs around in case they change something like the CPU architecture.

ChartDirector PDF Output

Did you know our MBS Xojo ChartDirector Plugin can be used to output charts as PDF files?

Two ways are possible:

Vector Mode

If all parts of the chart can be drawn in a PDF with the PDF support by ChartDirector, you get a vector graphics with lines, rectangles and paths. Text is drawn in PDF, so it can be selected later and copied.

Bitmap Mode

If some features are used, which are not supported for PDF output, you get a picture rendered and this picture is placed inside the PDF wrapper. Not perfect, but it preserves some 3D graphic effects, which can't be drawn natively in the PDF. If you set bitmap flag in the output options, you can enforce the bitmap mode.

Enable PDF

To enable PDF output, please call MakeChart() function and pass the kPDF constant. If you are interested in SVG output, please pass kSVG or kSVGZ constants. The second one is for compressed output.

If you pass an optional FolderItem parameter to MakeChart, you write an image file directly to that location. The file extension on the file name in the FolderItem defines the type, so please use png, jpg, jpeg, gif, wbmp, wmp, pdf, svg or bmp.

For a draw area, you can just ask it for PDF output using the outPDF() function. Either pass a FolderItem to create a PDF file or pass no parameter to get the PDF as text back. To get a draw area, you can for example call MakeChart without parameters.

Options

You can configure the PDF output with various options and the setOutputOptions method. You pass options with key=value separated by semicolons. e.g. you can use "pagewidth=595;pageheight=842" to use A4 paper size.


PDF OptionTypeDescription
bitmapFlag Render the chart as a bitmap and output the bitmap as PDF.
widthAttribute The width of the chart in the PDF in pixel unit.

By default, ChartDirector will use the pixel width of the chart as the width of the chart in PDF. The "width" attribute can be used to specify an alternative value. The value must be a number.
heightAttribute The width of the chart in the PDF in pixel unit.

See the description on "width" above for how to use it.
pagewidthAttribute The page width in pixel unit.

By default, ChartDirector will set the page width to the same width as the chart. The "pagewidth" attribute can be used to specify an alternative value. The value must be a number.
pageheightAttribute The page height in pixel unit.

By default, ChartDirector will set the page height to the same height as the chart. The "pageheight" attribute can be used to specify an alternative value. The value must be a number.
leftxAttribute The x coordinate of the left side of the chart within the page in pixel unit.

By default, ChartDirector will center the chart in the page. The "leftx" attribute can be used to specify an alternative horizontal position. The coordinate must be a number.
topyAttribute The y coordinate of the top side of the chart within the page in pixel unit.

By default, ChartDirector will center the chart in the page. The "topy" attribute can be used to specify an alternative vertical position. The coordinate must be a number.
dpiAttribute Specify the factor for conversion from pixel to physical unit.

The PDF viewer will convert the pixel unit into physical unit (eg. inches) so that it can be layout on paper or other physical media. The default conversion factor for the chart is 96 pixels per inch. The "dpi" attribute can be used to specify an alternative value. The value must be a number.

The test PDF on the right shown as picture is available here: finance.pdf

Please do not hesitate to contact us with questions.


Convert office documents to PDF with LibreOffice

See newer version here: Convert Office Files in FileMaker


Did you know you can use LibreOffice to convert your Word, Excel or Powerpoint documents to PDF files?

You can learn about command line commands in the help: Starting the LibreOffice Software With Parameters.

To show an example, let us convert a Word file to PDF on MacOS:

/Applications/LibreOffice.app/Contents/MacOS/soffice --convert-to pdf --outdir /Users/cs/Desktop /Users/cs/Documents/test.doc

or Windows:

"C:\Program Files\LibreOffice\program\soffice.exe" --convert-to pdf --outdir C:\Users\Christian\Desktop C:\Users\Christian\Desktop\test.docx
To run this, you can use Shell class in Xojo or Shell functions for FileMaker in MBS Plugin.

In Xojo, you can run this with the Shell class like this:

dim InputFile as FolderItem = SpecialFolder.Desktop.Child("test2.docx")
dim OutputFolder as FolderItem = SpecialFolder.Desktop

const AppPath = "C:\Program Files\LibreOffice\program\soffice.exe"
dim AppFile as new FolderItem(AppPath, FolderItem.PathModes.Native)

dim cmd as string = AppFile.ShellPath+ " --convert-to pdf --outdir " + OutputFolder.ShellPath + " " + InputFile.ShellPath

dim sh as new shell
sh.execute cmd

Enjoy conversion!

Set initial file for FileMaker 19 by script

Did you see the new feature in FileMaker Pro version 19 about setting an initial file to open when you launch FileMaker?

You can set this by script with MBS FileMaker Plugin by using Preferences.SetValue or Registry.SetValue functions as you see below.

MacOS

For MacOS you can use our Preferences.SetValue function to set the preferences value for "Preferences:UseInitialfile" to 1 to enable or 0 to disable. The preference value "Preferences:Initialfile" uses a Mac specific FileMaker path to the file to open. Here are the two MBS calls to setup a new path:

MBS( "Preferences.SetValue"; "com.filemaker.client.pro12"; "Preferences:UseInitialfile"; 1; "integer") &
MBS( "Preferences.SetValue"; "com.filemaker.client.pro12"; "Preferences:Initialfile"; "filemac:/Mac/Users/cs/Documents/Test.fmp12"; "text")

Windows

For Windows the preferences are stored in the registry, so you need to know the right key. There we set UseInitialfile with 1 or 0 to enable or disable with data type DWORD. The file path to the file is provided as a FileMaker path with filewin: prefix. Here is a sample call:

MBS( "Registry.SetValue"; "HKEY_CURRENT_USER\SOFTWARE\FileMaker\FileMaker Pro\19.0\Preferences"; "UseInitialfile"; 1; "DWORD") &
MBS( "Registry.SetValue"; "HKEY_CURRENT_USER\SOFTWARE\FileMaker\FileMaker Pro\19.0\Preferences"; "Initialfile"; "filewin:/C:/Users/Christian/Desktop/JavaScript.fmp12"; "text")

Automation

To automate installation on dozens of computers, you could do this by script when solution launches to define the file to open for next start. e.g. automatically install FileMaker, send user a welcome email and have them click fmp:// URL. That URL can trigger FileMaker to launch, open a remote database on the server as guest and show a welcome layout. And in a script to setup, you could define what file to open next time. And of course that file could be written to documents folder by script via an Export Field Contents script step. Please only do those steps with user consent!

To remove, you could set UseInitialfile flag to zero. To clear the path, you can use Preferences.DeleteValue and Registry.DeleteValue functions if needed.

Update: This works in FileMaker 18 even as there is no preferences. But it seems to work for us if you set the path.

If you have questions, please do not hesitate to contact us.

MBS Xojo Plugins, version 20.3pr4

New in this prerelease of the 20.3 plugins:
  • Fixed Options property in SQLConnectionMBS class to not clear exception state when debugging.
  • Added ClearRectangle and FillPath method support for Graphics class in DynaPDFMBS class.
  • Fixed issue with ArchiveReadDiskMBS class on Windows in case path ends with backslash.
  • Fixed an issue with calling RegisterMBSPlugins twice.
Download: monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.

MBS FileMaker Plugin, version 10.3pr4

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

Omegabundle for Xojo 2020

Get the top developer tools and third party components for the Xojo cross-platform development platform at a huge savings.

Omegabundle for Xojo 2020 is a collection of the most useful tool sets, add-ons, digital books and components for use with Xojo Inc's Xojo development environment. If purchased separately and not including any additional offers, the total cost would be over $3,711.00. Omegabundle for Xojo 2020 costs $399. Buy now on the Paradigma Software store.



Xojo is an award-winning, cross-platform development tool for the Desktop (macOS, Windows, Linux), Web, iOS (iPad/iPhone) and Raspberry Pi. With Xojo, you can create native applications by using drag-and-drop to build your user interface and then one straight-forward programming language to enable the functionality. Xojo is powerful and modern, yet easy to use and learn. (more)

Claris Partner Connect

Our company Monkeybread Software, legally Christian Schmitz Software GmbH, has been named a Claris Partner Connect: Find a Claris Partner.

Earlier this year Claris Inc. introduced their Claris Connect service and made a series of webinars to learn inform all partners about it. In one of the webinars they defined the challenge that interested partners can be come a Connect partner by fulfilling a few things. For us my co-worker Stefanie Juchmes made this for us.

Congratulations to Stefanie for doing this. And doing this in English is even more difficult for a non-native English speaker.

We look forward for Claris Connect starting in Europe with local servers and to get the details on how to integrate other services there, so maybe we can create a few for our clients.

PS: Looks like we are the first to do this in Germany.

Drawing with DirectDraw in Xojo

Have you seen DirectDrawGraphicsMBS class in latest MBS Xojo Plugins pre-release 3?

It allows you to draw lines, rectangles, ellipses and round rectangles with dashed lines and transparent colors.

All configurable as needed with standard or custom dash patterns. You can also set line width, what dash caps to use and what line joins to use.

We may add more methods if needed. Currently we wrap ID2D1RenderTarget interface in DirectDraw and provide a couple of methods to access feature there.
For MacOS you can use CGContextMBS class.

MBS FileMaker Plugin Presentation

Stefanie made a German version for the English MBS Plugin FileMaker presentation I made earlier this month:

Watch on Youtube   All our movies   Watch on Youtube in English.

We uploaded presentation slides to our website, too.

Please do not hesitate to contact us if you have questions.


Xojo reports with backgrounds on PDF

Did you know that you can use our DynaPDF graphics class integration in our MBS Xojo DynaPDF Plugin with the Xojo's report engine and output your reports as PDF files?

And while you are using DynaPDF, enjoy all the other features like importing existing pages and using them as background. This allows your application to take a PDF created by your user to put behind the reports to customize them.

Of course you can also use DynaPDF drawing functions to draw the report yourself. Or maybe better use DynaPDFTableMBS class to create tables for the layout. We have an excellent invoices examples for this.

To add a background, you can just drop in this code to load a PDF page from a template PDF instead of the normal append call to create a new blank PDF page:

// optionally put a background in the PDF Dim fi As FolderItem = SpecialFolder.Desktop.Child("template.pdf") If fi <> Nil And fi.Exists Then // ask plugin to ignore clearRect call from Xojo, so we see what's behind report pdf.ClearRectMode = pdf.kClearRectModeIgnoreBig Call pdf.OpenImportFile(fi) // needs Lite 'Call pdf.ImportPDFFile // needs Lite Call pdf.ImportPDFPage(1) // needs Pro If pdf.GetPageCount = 1 Then // okay Call pdf.EditPage(1) Else // import failed? Call pdf.Append End If Else Call pdf.Append End If

As you see we have to set our ClearRectMode property to ignore any ClearRect call which would clear the page. Otherwise the background is replaced with a white rectangle. The property is new in version 20.2 of our MBS Xojo DynaPDF Plugin.

See also Graphics class for DynaPDF and Create a PDF with PageGraphics and DynaPDF on our blog.

Please do not hesitate to contact us with your questions.


Swiss QR-Codes for invoices as vector graphics

As you may know the MBS FileMaker Plugin can create Swiss QR-Codes for invoices (ISO 20022) with our Barcode functions. We have an older example which generates QR Codes for Invoices in Switzerland as picture and place them in a container field to print them. But there is another way by doing vector graphics like the new example here to put the barcode on top of an existing PDF:



You like to know how we did it? (more)

MBS Xojo Plugins, version 20.3pr3

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

MBS FileMaker Plugin, version 10.3pr3

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

FileMaker 19 improves layering of controls

Did you notice the layering improvements in FileMaker 19?



Compared to older versions, the new FileMaker version now uses individual controls for layer elements. That allows the OS to do hardware acceleration and FileMaker may only need to redraw the parts which changed, leading to bigger performance.
For you, it does have the advantage that you can now better layer objects on top of each other like a button on top of a web viewer.

For next plugin we'll adjust our code to place plugin controls on the window to work better.

Watch Xojo Conference videos on Youtube

While staying at home, I enjoyed watching some videos for sessions from past Xojo conferences

It's great to hear those familiar voices and see some of my fellow Xojo developers on screen. Watching again I find new details I missed when I watched them before or sat in that room.

Over 50 videos available:
Additional videos may be added to the Youtube playlists later. See also our MBS Xojo Videos.

MBS Xojo Plugins, version 20.3pr2

New in this prerelease of the 20.3 plugins:
  • Rewrote ScreenshotRectMBS for MacOS to work better.
  • Changed DynaPDFMBS class to use Helvetica 12pt as fallback font if you write text to a new page without setting font.
  • Updated LCMS to version 2.10.
  • Fixed SystemInformationMBS.MACAddress to not add extra double points on the end.
  • Added MainResourceData method to WKWebViewMBS class.
  • Fixed problem with WriteStyledTextEx in DynaPDFMBS class to not set font with empty font name.
  • Added deleteSelection, selectAll, paste, cut and copy to WKWebViewMBS class.
  • Added new Type constants for LCMS2MBS module.
  • Added WebArchiveData method to WKWebViewMBS class.
Download: monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.

MBS FileMaker Plugin, version 10.3pr2

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

Xojo Meeting in Atlanta

For already nine years the Xojo group in Atlanta meets regularly every month. The last two meetings where cancelled due to Covid-19, but they are back for June!



The Xojo Atlanta group is meeting 9th June 2020.
Usually the meeting is in the Las Palmas Mexican Restaurant, 2210 Holly Springs Parkway, Canton, GA 30115.

I visited Atlanta twice myself, once in 2011 for the REALsummit conference and again in 2016 for a stop over at the airport, where I stopped by the Xojo meeting.

How FileMaker.PerformScript triggers scripts

At dotfmp we had a small extra session with Russell Watson, Peter Wagemans, Andries Heylen and Shin talking about building a new JavaScript thing to make using FileMaker.PerformScript easier. You know a few developers came up with code around FileMaker.PerformScript to delay a call until the function is available, to repeat calls if a JavaScript exception is rasied and try again or to find standard ways to work with promises to have the FileMaker script call back to JavaScript in order to acknowledge that it was called successfully.

 

But in-between, we noticed something else and today I verified this in the office before posting a blog post. FileMaker.PerformScript triggers the script you call immediately. It does not wait for current script to finish and just pushes any current script down on the call stack and puts the new script on top, so it runs directly. That is different to plugins starting scripts as they get added to the queue and start whenever the current scripts are finished.


(more)

Working with Webkit Message Handlers in FileMaker

You may know that we added our script message handler functions in version 8.0 about two years ago. The feature was brand new in WebKit and you could use our WebView.AddScriptMessageHandler function to install a callback in the web viewer.

Fast forward to FileMaker 19, the same technique is used by Claris to provide the FileMaker.PerformScript function for MacOS and iOS. And with our plugin functions can we manipulate this and control whether it works or not.

If you look into the FileMaker.PerformScript function (see blog post The FileMaker.PerformScript function in FileMaker 19), you can see the message handler is named "fm". And this handler can be removed if needed with WebView.RemoveScriptMessageHandler function. If needed you can disable the feature once you don't need it any more. Or if the website you load is not trusted and you want to prevent it to trigger FileMaker scripts.

To restore the message handler, you can use WebView.AddScriptMessageHandler with name "fm". In next 10.3pr2 plugin we added a check there, so if you use that name, we restore the default FileMaker handler and not ours.

If you like to check whether the FileMaker.PerformScript function is ready, you can check with a call to WebView.Evaluate:

MBS( "WebView.Evaluate"; "web"; "typeof(FileMaker)")

This returns "object" if the object exists or "undefined" if not. By default FileMaker installs the FileMaker object once the page is loaded. We recommend putting in an "about:blank" as URL into the web viewers on the layout to make them be initialized earlier before you may set an URL in a script. Unless an URL is loaded into a web viewer, it is non existent and all plugin functions can't find it.

Dash help archives for FileMaker 19

For browsing help files, the Dash application is very useful on Mac and iOS.
We just uploaded newer dash files for FileMaker 19.

Here you can click to launch Dash and install our plugin help or download them for manual installation:

FileMaker:
Dash link for MBS FileMaker Plugin
Our Dash page for FileMaker for manual download
For FileMaker you find the docsets for version 19 here: FileMaker Dash Docsets

Xojo
Dash link for MBS Xojo Plugin
Our Dash page for Xojo for manual download
You can also add Xojo documentation itself to your dash set, see download in preferences dialog.


Feedback is welcome.

FileMaker 19 - Exklusives Online Launch Event bei der Denkform

Die denkform® GmbH lädt zu unserem exklusiven FileMaker 19 Online Launch Event ein. Dieses Jahr virtuell via Blizz, einer Videochat Software aus Deutschland von der Firma, die Teamviewer macht.

Themen

  • Lars Seliger zeigt die Neuerungen in FileMaker Pro 19
  • Christian Schmitz von MonkeyBreadSoftware zeigt alle Neuerungen in seinem einzigartigen und mächtigsten MBS Plugin für FileMaker.
Anmeldung auf der Denkform Webseite.

Für das MBS Plugin empfehlen wir vorab die Präsentation hier zu schauen. Wir zeigen dann ausgewählte Funktionen und Beispiele vom MBS Plugin im Webinar.

Xojo's seventh birthday

Xojo turns seven years old today.

On 4th June 2013, Xojo Inc. announced the name change from Real Studio to Xojo, the new IDE and the new license model.

Originally Xojo started over 20 years ago as CrossBasic, got rebranded as REALbasic and released in 1998 to the public. In 2010 the name was changed to Real Studio before in 2013 the company and its product were renamed to Xojo. See Wikipedia for details.

Congratulations to the team and looking forward to the next 20 years!

See you at the Xojo Conference in London next year.

MBS FileMaker Plugin Presentation

For the upcoming virtual dotfmp conference, we prepared a presentation video to show you what MBS FileMaker Plugin can do:

All movies   Watch on Youtube.

Please do not hesitate to contact us if you have questions.


Dynamic Declare for Xojo

For MBS Xojo Plugins in version 20.3 we include a new set of classes to do load C libraries and call functions there. Similar to the declare commands in Xojo, but much more dynamic and with additional features:

Libraries

Our new DeclareLibraryMBS class allows you to load a library file. On MacOS you load a dylib file, on Windows a DLL file and on Linux a shared object file with so file extension.

Just pass the file path (can be relative) or the folder item for the library file to the constructor for DeclareLibraryMBS. Then you can check with SymbolNames function the array of exported functions defined in the library. Once you picked a function name, you can use Symbol function to query the function pointer for an exported function.

(more)

Sponsoring DotFMP 2020

This week the dotfmp.berlin conference starts and Monkeybread Software sponsors the event. This year the event will be virtual with many more attendees and as you may know, servers to host such an event still cost money. Here the overview of the supporters:



We wish everyone a great conference this week!
For MBS Session, we'll provide a video of the presentation and then do a Q&A session to show some examples and answer questions.

MBS Xojo Plugins, version 20.3pr1

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

MBS FileMaker Plugin, version 10.3pr1

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

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