Our Blog,   Our Claris FileMaker Blog,   Our Xojo Blog,   Archive (older)     Follow us on Twitter, Xing, LinkedIn or Facebook.

New error log functions for FileMaker

For last version, we got the functions ClearErrors and HadErrors to track whether a script had errors. You can think here like a try catch, where you can run a script later check in the script whether something failed and log that failure. At the MBS FileMaker Plugin workshop this week, we got a few new ideas to catch errors better. We got the idea to collect error logs and provide them as JSON to the developer.

 

Let us show you a test script:

 

# start error logging

Set Variable [ $r ; Value: MBS("ClearErrors") ] 

# cause some errors

Set Variable [ $r ; Value: MBS("test"; 1; "Hello") ] 

Set Variable [ $r ; Value: MBS("DynaPDF.Print"; 1; "Hello") ] 

# now query error log

Set Variable [ $r ; Value: MBS("ErrorLog") ] 

Set Field [ Kontakte::Nachname ; $r ] 

Show Custom Dialog [ "Error Log" ; $r ] 

 

As you see we call ClearErrors function early to clear the list (if needed). Then we cause two MBS errors here and don't check result right away. 

(more)

Sending email via gmail

Recently a client had questions on how to send an email using our CURLEmailMBS class via gmail service and our CURLSMBS class. There are a few challenges:

  1. You need to know what server to use. That is easy for google mail and smtp.gmail.com will do it.
  2. You need to know your login credentials. Your account should have 2 Factor Authentication. But you never pass your gmail password to an application directly. You go to the google website, login and then create an app-specific password for smtp. The advantage is that you can disable that password later, if it got stolen and create a new one.
  3. You need to know the port to use. Basically port 25, 465 and 587 all can work. But 25 and 587 connect in plain text and do the TLS upgrade later after discussing the details of the supported encryption variants. For port 465, the first package is encrypted and for that we would tell the plugin to use TLS directly. That is our UseSSL flag, you can set when using port 465. To set the port, please either put in the server, e.g. "smtp.gmail.com:587" or later set it on the CURL object with OptionPort. For gmail the default port 25 works just fine here.
  4. You need to know what TLS version is allowed. For our example we don't need to set an explicit version. CURL now tries TLS 1.3 and falls back to version 1.2 if the server doesn't support it. But you can set a version as minimum.
  5. Since gmail doesn't do plain text, we tell CURL to require SSL with OptionUseSSL = kUseSSLall.
(more)

Add page links for FileMaker

Recently a client asked how to make existing index pages clickable in a PDF document. They have existing documents in FileMaker and like to customize them with our DynaPDF functions.

One part of the customization is to make some texts clickable. I recently proposed them to use DynaPDF.ExtractText to read the page number and then use DynaPDF.PageLink function to make the page. To know the distance, the layout has fields to enter where to find the numbers on the right side of the index page. Our loop runs from bottom to top of the page, checks every box for text and if there is a text, we make a link for that page.

 

Here is the script:

 

# Initialize DynaPDF if needed

If [ MBS("DynaPDF.IsInitialized") ≠ 1 ] 

Perform Script [ Specified: From list ; “InitDynaPDF” ; Parameter:    ]

End If

# Clear current PDF document

Set Variable [ $pdf ; Value: MBS("DynaPDF.New") ] 

# optionally we can merge to external file

If [ False ] 

Set Variable [ $destPath ; Value: MBS("Folders.UserDesktop") & "/test.pdf" ] 

Set Variable [ $r ; Value: MBS("DynaPDF.OpenOutputFile"; $pdf; $destPath) ] 

If [ MBS("IsError") ] 

Show Custom Dialog [ "Failed to create PDF file." ; $r ] 

Exit Script [ Text Result:    ] 

End If

End If

(more)

Merge PDFs with page numbers in Xojo

You can use DynaPDFMBS class in MBS Xojo DynaPDF Plugin for a lot of PDF operations. Create PDF from scratch, add content like text, tables, vector graphics, images and place existing PDF content as templates. You can merge, split, encrypt, decrypt, optimize and print PDF documents.

Let's show you how to do merge in DynaPDF with the following method snippet:

Sub Merge() Dim pdf As New DynapdfMBS pdf.SetLicenseKey "Lite" // For this example you can use a Lite, Pro or Enterprise License Dim outFile As folderitem = GetSaveFolderItem(MyFileTypes.Pdf, "Merge.pdf") If outFile = Nil Then Return // cancelled Call pdf.CreateNewPDF(outFile) // we import all content and as pages Dim flags As Integer = Bitwise.BitOr(pdf.kifImportAsPage, pdf.kifImportAll) Call pdf.SetImportFlags(flags) // loop over list to import all files there Dim c As Integer = List.ListCount-1 For i As Integer = 0 To c // we store folderitems for file references in the CellTag here. Dim file As FolderItem = List.CellTag(i, 0) // open file Dim FileHandle As Integer = pdf.OpenimportFile(file, pdf.kptopen, "") If FileHandle >= 0 Then // import all pages Call pdf.ImportPDFFile(pdf.GetPageCount+1, 1.0, 1.0) // alternatively with Pro license, import individual pages 'Call pdf.ImportPDFPage(1) Call pdf.CloseImportFile End If Next // optional edit all pages to have new text for page numbers If CheckPageNumbers.Value Then AddPageNumbers pdf End If Call pdf.CloseFile // open in preview outFile.Launch End Sub
(more)

MBS Xojo Plugins, version 22.3pr4

New in this prerelease of the 22.3 plugins:
  • Fixed PCRE2MatchDataMBS class to not crash with querying StartPosition in an empty matchdata object.
  • Updated Rockey4ND libraries, including Apple Silicon and Linux 64-bit for ARM.
  • Updated to DynaPDF 4.0.68.186.
  • Added more plugin support for Windows.
  • Added SetTemplBBox method to DynaPDFMBS class.
  • Added SetStackSize method to PCRE2MatchContextMBS class.
  • Implemented Constructor taking picture for CVPixelBufferMBS to work on iOS.
Download: monkeybreadsoftware.com/xojo/download/plugin/Prerelease/ or from DropBox.
Or ask us to be added to our shared DropBox folder.

MBS FileMaker Plugin, version 12.3pr4

New in this prerelease of version 12.3 of the MBS FileMaker Plugin:
  • Added PDF support for Vision.RecognizeText function, so you can get live text from PDF documents.
  • Added ' to list of allowed characters for variables or function names in syntax highlighting.
  • Updated to DynaPDF 4.0.68.186.
  • Added DynaPDF.SetTemplBBox function.
  • Updated to LibXL 4.0.4.
Download at monkeybreadsoftware.com/filemaker/files/Prerelease/, in DropBox folder or ask for being added to the DropBox shared folder.

Claris FileMaker 19.5 available

Today Claris released the new version 19.5 update for their FileMaker platform. A lot of new features are included and a lot of bug fixes are appreciated.

See announcement in the Claris Community:

Claris FileMaker 19.5 now available.

Release notes:

FileMaker Pro 19.5.1 Release Notes
Claris FileMaker Server 19.5.1 Release Notes

And documentation:

New features in FileMaker Pro 19
New features in FileMaker Server 19

We recommend the current 12.2 version for MBS Plugin for use with FileMaker 19.5. Older plugins may work, but you will miss out various bug fixes and improvements we made for 19.4 and 19.5.

As you may notice the LiveText feature is already available in MBS FileMaker Plugin for years with the Vision.RecognizeText function. And we are curious to see how the QRCode function in FileMaker relates to our Barcode.Detect and Barcode.Scan functions.

MBS FileMaker Plugin, version 12.3pr3

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

MBS Xojo Plugins, version 22.3pr3

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

Configure Audit functions in MBS Plugin

If you use Audit functions in MBS FileMaker Plugin, you can configure them with a couple of options, so let's check the options.

Date and time as numbers

For years we had the problem, that two people working on a database may have different locale. So one opens a records and saves it with "12.05.2022" as date (12th May). Then another user looks on the record and FileMaker formats it in different locale as 05/12/2022 and saves that. The Audit log would record that as a change and cause a lot of extra log entries.

To avoid this trouble, we added an option for 12.3 to store the time, date and timestamp values as numbers. Once turned on with Audit.SetDateAndTimeAsNumbers function, you see them stored numerical. Of course if you have old entries, those will now be logged again with their numeric value. So better start using this when you start with a fresh AuditLog. (more)

MBS FileMaker Plugin 12.2

In this article we want to introduce you the new functions from the MBS FileMaker Plugin in version 12.2.

Error Count for MBS functions

For years we already have the isError function in the MBS FileMaker Plugin. We can call this after a MBS function to see if the previous MBS function returned an error. If you use many MBS functions in a script this can get confusing and it might be enough for you, e.g. if you are testing a script, to know if a plugin function in the whole script throws an error at all. For this we have developed two new functions. With the HadErrors function you get back the number that is currently in the error counter. This will be incremented by one whenever a MBS function returns an error. If you want to log the errors of a script, you first have to call the ClearErrors function to set the Error Count to 0. At the end of the script you can then call the HadErrors function.

(more)

News from the MBS Xojo Plugins Version 22.2

In this article I want to introduce you the new functionalities from the MBS Xojo Plugins in version 22.2.

PCRE2

In the Regular Expressions topic there are huge changes. So far we have had the class RegExMBS. This is now deprecated and is no longer being developed, but remains in the plugin and can be used. We now provide the more modern classes:

If you want to learn more about the new functionalities, I recommend you to read our blog article New PCRE2 Plugin for Xojo which deals with the topic in more detail.

(more)

Multi Year Updates

If you have a license for our plugins, you can renew it at any time and add additional years at current pricing.

While our updates are already discounted at 50%, you can take multiple years and get an additional discount:
  • 2nd year with 10% reduction
  • 3rd year with 20% reduction
  • 4th year with 20% reduction
  • 5th year with 20% reduction
For example a $99 update for 5 years would be factor 4.3 instead of 5, so $425.70 instead of $495 with a $69.3 discount.

Please contact us to let us know you like to order with discount, so we can raise a custom invoice for your purchase.

If you order a multi year update via our web shop for full price, we can extend the MBS Plugin licenses (not DynaPDF or LibXL) with extra months instead of a discount:
  • 2 years -> 1 month extra
  • 3 years -> 3 months extra
  • 4 years -> 6 months extra
  • 5 years -> 9 months extra
This should be about the same level of discount. In any case, please let us know in advance. With ordering now in advance, you can secure current pricing.

And of course we appreciate the trust that customers put into us when they update for several years.

Please note that you may need to depreciate the value of the purchase over multiple years in most countries.

CNContactPickerViewController for Xojo

You may know that our MBS Xojo Plugins contain classes for Contacts for macOS and iOS. And now we add a new CNContactPickerViewControllerMBS class, so you can use the standard picker on iOS to pick a contact.

You subclass the CNContactPickerViewControllerMBS class and fill the events or use addHandler to connect the events to your methods. There is didCancel event in case user presses cancel button and there are events for one (or multiple) contacts selected or contact properties. Depending on which event you implement, the picker will be single or multi selection and may show contact properties.

So let's subclass and fill the events:

Class MyCNContactPickerViewControllerMBS Inherits CNContactPickerViewControllerMBS
Sub didCancel() System.DebugLog CurrentMethodName End EventHandler
Sub didSelectContact(contact as CNContactMBS) MessageBox "Picked: " + contact.givenName + " " + contact.familyName End EventHandler
End Class
(more)

Comment Links in FileMaker ScriptWorkspace

At the dotfmp conference we got a nice idea for a feature: MBS FileMaker Plugin already scans script lines to find missing variables and show a little warning for undeclared variables. We added the feature to scan for comments containing URLs. If we find an URL, we add a little button to the end of the line, which currently shows an arrow and a globe:



You may click on the line to select it and then click on the control we add. Maybe double click may also work directly. But only if the list of script steps doesn't consume the click, it will come to our control.

You can configure this via our preferences dialog or the new SyntaxColoring.CommentLinks.SetEnabled function, so you can turn it on and off via script if needed.

Available in 12.3pr2 on our website for FileMaker Pro on macOS.

MBS Xojo Plugins, version 22.3pr2

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

MBS FileMaker Plugin, version 12.3pr2

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

OnRecordEdit Trigger in FileMaker

At dotfmp conference someone mentioned that he is missing a trigger in FileMaker Pro for when the user starts editing the record and thus locks it. While FileMaker has trigger for record load, commit and revert, there is no edit one. You may do something with a Layout Keystroke, but not all editing is by keyboard usage.

 

We can implement such a trigger with MBS FileMaker Plugin, our schedule functions and FM.RunScript. When record loads, we start a timer to evaluate an expression every second. This calculation checks whether RecordOpenState changes to 2 for editing and then runs the script to trigger. 

 

Our example uses a Status field in a Status table to show the status. This must be a field in another table to avoid our current record get state changed by our Set Field call. We start with the OnRecordLoad script to set our status and start the timer with Schedule.EvaluateAfterDelay. Delay is 1 second and repeat each second. The expression checks Get(RecordOpenState) and if it is 2, first stops the schedule and then runs a script in the current file named OnRecordEdit:


(more)

More Context Menu Commands for FileMaker

For next plugin version we added contextual menu entries for lists in the FileMaker user interface with expandable folders:
You can expand or collapse all with a context menu command.

And once we had that, we got another idea:
We can look on the names and find duplicates. If you ever use "Go To Layout" with name, you may have run into a problem with duplicate layout names. Our plugin selects all duplicate entries, so you can see which are belonging together.

And of course our contextual menu allows you to open the find tools, do copy and paste like the edit menu and show you how many entries are selected.

You can try next week in the version 12.3pr2 for macOS.

MBS FileMaker Plugin, version 12.3pr1

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

Older blog entries:

2022-06-02 MBS Xojo Plugins, version 22.3pr1
2022-05-30 MBS FileMaker Plugin English 2022 Update
2022-05-30 MBS FileMaker Plugin Deutsch 2022 Update
2022-05-28 New Feedback web app for Xojo
2022-05-24 Beta for upcoming Froodware Plugins
2022-05-24 Xojo Stammtische in Berlin und Hamburg
2022-05-17 MBS Plugin 12.2 for Claris FileMaker
2022-05-17 MonkeyBread Software Releases the MBS Xojo Plugins in version 22.2
2022-05-17 Neues MBS Plugin 12.2 für Claris FileMaker
2022-05-13 MBS FileMaker Plugin, version 12.2pr7
2022-05-13 MBS Xojo Plugins, version 22.2pr7
2022-05-12 XDC Developer Retreat 2022
2022-05-10 Froodware plugins handed over to MonkeyBread Software
2022-05-10 MBS Xojo Plugins, version 22.2pr6
2022-05-10 MBS FileMaker Plugin, version 12.2pr6
2022-05-08 MBS Xojo ChartDirector Plugin Birthday
2022-05-06 xDev Magazine 20.3
2022-05-06 Documentation links for Get functions in FileMaker
2022-05-05 Iterate with PCRE2
2022-05-05 Custom Functions in JavaScript reloaded

Archives

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