Image Zoom in Container

You remember my blog post Interactive FileMaker Containers are Webviewers?

Today we had more fun with images:



As you see we can zoom in for images in interactive containers using JavaScript and our WebView.RunJavaScript function. And of course we can center the zoomed image or scroll to any position.

Here the function call to switch width and height of the image to nature size:

MBS("WebView.RunJavaScript""ImageContainer";

 

// get image into variable

"img = document.getElementsByTagName('img')[0];" &

 

// remove CSS

"img.style = '';" &

 

// set width and height to 500px

"img.width = img.naturalWidth;" &

"img.height = img.naturalHeight;" )

And to scroll in the center position.

MBS("WebView.RunJavaScript""ImageContainer";

 

"document.body.scrollLeft = (document.body.scrollWidth - window.innerWidth)/2;" &

"document.body.scrollTop = (document.body.scrollHeight - window.innerHeight)/2;") 

This example will be included with next prerelease. Please do not hestiate to contact me for questions or to get a copy by email.


FileMaker Magazin 1/2017

Die neue Ausgabe vom FileMaker Magazin ist da. Im 143. Heft erwartet Sie:
  • Plugin-Installation
    Wie man FileMaker Plugins richtig installiert | Christian Schmitz
  • Wer Backups macht, ist nicht feige, sondern klug
    Automatische Backups mit Historie in FileMaker | Markus Schall
  • Schnell, schneller, FMPerception
    Ein neues Analys-Tool für FileMaker | Jörg Köster
  • Beezwax InspectorPro 6
    Wieso ist ein Analysewerkzeug für FileMaker Datenbanken hilfreich? | Thomas Hirt
  • Per Shellscript scannen
    Dokumentenerfassung ohne Plugin | Gunnar Wehrhahn
  • Portale im Eingabemodus
    Eine einfache Möglichkeit zur Dateneingabe | Rudolf Lehn
  • Erstellen einer einfachen Anwendung mit FileMaker
    Ein Volltextsucharchiv für das FileMaker Magazin und Zeitschriften im PDF-Format, Teil 5 | Burkhard Quenzler
  • Das Problem der Scheinselbstständigkeit
    Vorsicht Falle! | Christoph Kluss
  • Das klingt irgendwie logisch
    Ein Funktionensystem für Logikoperationen auf Bitniveau, Teil 1 | Erich Schmidt
  • FMM Titelwahl 2016
    Favorit gesucht | FMM Redaktion
  • Leserbrief
    Zur Buchbesprechung FMM_201606 „FileMaker 15 für alles und jeden“ | Rainer Maschke
  • Ein Samstagmorgen im Verlag
    Stelldichein bei Sekt & Schnittchen | FMM Redaktion
Zudem Neuigkeiten, Kleinanzeigen, aktuelle Versionen, Adressen, Stammtische und vieles mehr.
Ein Abo sei allen FileMaker Anwendern mit Deutschkenntnissen empfohlen :-)

FileMaker DevCon 2017 with MBS booth



See you in Phoenix Arizona for the FileMaker Developer Conference, 24th to 27th July 2017.
MBS will be present with a booth in the vendor area. If you like to join the conference, be sure to buy your ticket till 28th February for the best price.

A Calendar running in WebViewer in FileMaker

On a recent trip to Switzerland I had a training day and spontaneously we created an example project using a JavaScript based calendar in a WebViewer.
We use a lot of MBS Plugin functions to initialize this and run the JavaScript.

Calendar in FileMaker with MBS Plugin

While we will include it with next plugins in examples, this is only half done. So take the chance to learn and see how you can call JavaScript and catch events.

Next trainings:

MBS FileMaker Plugin, version 7.1pr3

New in this prerelease of the 7.1 MBS FileMaker Plugin: Download at monkeybreadsoftware.de/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder. PS: Due to an oversight, this pr3 plugin has 2 as version number.

Create PDF with Embedded Links in FileMaker using MBS Plugin

One of our plugin users, Kevin Frank, wrote a nice article on his filemakerhacks blog about using embedded links in a PDF document.

With FileMaker you can create PDFs from your records. Using DynaPDF functions in MBS Plugin you can merge several PDFs, but how to do a table of contents page?
Kevin explains how he uses our plugin to add the clickable links on the first page with the list of topics, so each click jumps to the right page.

Read yourself here: filemakerhacks.com/2017/02/21/pdf-with-embedded-links/

Thanks for sharing and for asking for more functions. You need plugin version 7.0 or later for the example.

Using Apple's Global Service Exchange web service in FileMaker

Quite a few Apple shops use FileMaker and/or Xojo for their development of in-house tools. A common request is to use Apple's webservices to query warranty status. So today I want to show some scripts on how to do this. First of course you have to ask Apple for a GSX login which may require some paperwork. Next you need to white list your static IP for their webservice and get the credentials.
 
You request a certificate from Apple, so you generate a private key. The tricky key is to copy the private key with the certificate into one pem file. This pem file is than used wiht our script. Also please download a standard cacert.pem file with root certificates.
The first script logs into the webservice from Apple. We pass the user id and service account id in the login request. 
 
#Parameters

Set Variable [$path; Value:"/path to files/"]

Set Variable [$userid; Value:"xxx"]

Set Variable [$serviceAccountNo; Value:"yyy"]

Set Variable [$PrivateKeyPassword; Value:"secret password"]

#Build the XML

Set Variable [$xml; Value:GSX::Login XML Template]

Set Variable [$xml; Value:Substitute($xml; "$userId$"; MBS("Text.EncodeToXML"; $userid))]

Set Variable [$xml; Value:Substitute($xml; "$serviceAccountNo$"; MBS("Text.EncodeToXML"; $serviceAccountNo))]

#Start curl session

Set Variable [$curl; Value:MBS("CURL.New")]

Set Variable [$r; Value:MBS("CURL.SetOptionURL";$curl; "https://gsxapi.apple.com:443/gsx-ws/services/emea/asp")]

#We use a PEM file with private key and our certificate

Set Variable [$r; Value:MBS("CURL.SetOptionSSLCertType"; $curl; "PEM")]

Set Variable [$r; Value:MBS("CURL.SetOptionKeyPassword"; $curl; $PrivateKeyPassword)]

Set Variable [$r; Value:MBS("CURL.SetOptionSSLCert"; $curl; $path & "your.pem")]

#and the usual root certificates

Set Variable [$r; Value:MBS("CURL.SetOptionCAINFO"; $curl; $path & "cacert.pem")]

#Use TLS v.1.2

Set Variable [$r; Value:MBS("CURL.SetOptionSSLVersion"; $curl; 6) // TLS v1.2]

#Wait for 10 seconds

Set Variable [$r; Value:MBS("CURL.SetOptionTimeOut"; $curl; 10)]

#Specify content type and SOAP Action for webservice

Set Variable [$r; Value:MBS("CURL.SetOptionHTTPHeader"; $curl; "Content-Type: text/xml; charset=UTF-8"; "SOAPAction: \"urn:authenticate\"")]

#Pass XML to CURL

Set Variable [$r; Value:MBS("CURL.SetOptionPostFields"; $curl; $xml)]

#Run the request

Set Variable [$r; Value:MBS("CURL.Perform"; $curl)]

#Check result by storing result, debug log and output data in fields

Set Variable [$httpResponse; Value:MBS( "CURL.GetResponseCode"; $curl )]

Set Field [GSX::CURL Result; $r]

Set Field [GSX::CURL Input; $xml]

Set Field [GSX::CURL Debug; MBS("CURL.GetDebugAsText"; $curl; "UTF8")]

Set Field [GSX::CURL Output; MBS("CURL.GetResultAsText"; $curl; "UTF8")]

If [$r = "OK" and $httpResponse = 200]

#on success, get our session id

Set Field [GSX::SessionID; MBS("Text.FindBetween"; GSX::CURL Output; "<userSessionId>"; "</userSessionId>")]

End If

#always clean up

Set Variable [$r; Value:MBS("CURL.Cleanup")]


(more)

Workshop zum MBS FileMaker Plugin @ Denkform

For our German speaking clients we have a workshop day: In Zusammenarbeit mit der DenkForm GmbH bieten wir eine Schulung zum MBS Plugin an. Am 2. März 2017 (und 7. Dezember 2017) können Sie in Hofheim am Taunus an einer eintägigen Schulung teilnehmen. Lernen Sie die über 4400 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
  • 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 Formulares auf einer Webseite
  • Bilder bearbeiten
  • PDF Verarbeitung
  • Druckerfunktionen
  • Adressbuch und Kontakte abfragen bei Mac OS X.
  • Fragen und Antworten
Die Teilnahme kostet 99 Euro inkl. MWSt. und Verpflegung. Details und Anmeldung bei der Denkform. Im Anschluss geht es noch zur Pizzeria zum FileMaker Stammtisch Rhein-Main. An jedem ersten Donnerstag im Monat findet ab 19 Uhr der "FileMaker Stammtisch Rhein-Main" statt, zu dem jeder herzlichst eingeladen ist. PS: Die Schulung findet statt.

Dash help archives for Xojo and FileMaker

For browsing help files, the Dash application is very useful on Mac and iOS.

Here you can click to launch Dash and install our plugin help:
MBS Xojo Plugin and MBS FileMaker Plugin

You can download the archives manually on our website:
FileMaker and Xojo (Real Studio).

You can also add Xojo documentation itself to your dash set, see download in preferences dialog.
For FileMaker you find the docsets for v15 here: FileMaker Dash Docsets

Feedback is welcome.

Worldwide first curl conference in Germany, March 2017

On the weekend of March 18-19, 2017, the first ever curl conference is taking place is Nuremberg, Germany.

Users, developers, binding authors, application authors, curl maintainers, libcurl hackers and other people with a curl interest are welcome!

I will be there and finally meet the curl people. I've been using curl for various projects including Xojo and FileMaker plugins for over 10 years.
Do you also come?

Dialogs with more buttons in FileMaker

Today I presented my MBS Plugin and showed with a lot of other things my Dialog functions. Someone asked how many buttons we can have and they had the wish to show more than three:

So for next plugin version, we can have up to 10 buttons.
Mac and Windows. Want to try? Just email me.

MBS FileMaker Plugin, version 7.1pr2

New in this prerelease of the 7.1 MBS FileMaker Plugin:
  • Updated DynaPDF to version 4.0.8.21.
  • Added DPI support to various functions returning images.
  • Updated SQLite to 3.17.0 prerelease version.
  • Fixed a problem in Audit which caused a crash if no FieldID was found.
  • Changed Printer.Print to make printer name optional.
Download at monkeybreadsoftware.de/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder.

FileMaker Custom function to query a value from other table or file

Today I have a custom function for FileMaker for you. It allows you to query any value in your databases by referring to the record by a field and it's value.
This can avoid complex relations if you just run a little query:

// Custom Function QueryValue

//

// Parameter:

// theFileName: the file name of the database. Empty for current.

// theFieldToQuery: the field name we want to query

// theFieldToMatch: The field to look for (primary field). Can be RowID for record ID.

// theValueToMatch: The value of the match field. Must match in data type

// 

 

Let ( [

// put quotes around field names unless it is RowID

theFieldToMatch = If(theFieldToMatch = "RowID"; theFieldToMatch; "\"" & theFieldToMatch & "\"");

theFieldToQuery = If(theFieldToQuery = "RowID"; theFieldToQuery; "\"" & theFieldToQuery & "\"");

 

// put quotes around the table name

theTable =  "\"" & theTable & "\"";

 

// Now run query

SQLRef = MBS( "FM.SQL.Execute"; theFilename; "SELECT " & theFieldToQuery & " FROM " & theTable & " WHERE " & theFieldToMatch & " = ?"; theValueToSearch);

 

// if no error, get first value

result = If(MBS("IsError"); SQLRef; MBS( "FM.SQL.Field"; SQLRef; 0; 0 ));

 

// if no error, release the recordset from memory

r = If(MBS("IsError"); ""; MBS( "FM.SQL.Release"; SQLRef ))

 

// return result

] ; result )

By using FM.SQL.Field, we get the field in it's original data type. So a container stays a container and a number stays a number. Converting to text would destroy them and cause problems. For example you can use this query to show a picture (container field) of a user if you know the user's login name for the query:

Set Field [Test::Picture; QueryValue(Get(FileName); "Picture"; "PersonID"; $PersonID) ] 

The advantage is that you don't need a relation and you can query it at any time anywhere.  

A special field name is RowID which allows you to query with using record ID. This is internal FileMaker number for a record which you query by Get(RecordID).

Works with current MBS Plugin and FileMaker with FileMaker 11 and newer.


Tip of the day: Connect to MySQL and run a query

With MBS Plugins you can connect to various databases from Xojo and FileMaker.
As you may know we support Centura SQLBase, DB2, Firebird, Informix, InterBase, MariaDB, Microsoft Access, Microsoft SQL Server, MySQL, ODBC, Oracle Database Server, PostgreSQL, SQL Anywhere, SQLite, SQLCipher and Sybase. 
 
Here an example script for FileMaker using MySQL: 
 

#Start a new connection

Set Variable [$Connection; Value:MBS("SQL.NewConnection")]

#Tell plugin where MySQL library is (put it where you like)

Set Variable [$result; Value:MBS("SQL.SetConnectionOption"; $Connection; "MYSQL.LIBS"; "/Users/cs/Desktop/libmysqlclient.dylib")]

#Connect to a mysql database:

Set Variable [$result; Value:MBS("SQL.Connect"; $Connection; "192.168.11.51@Server_Config"; "user"; "password"; "MySQL")]

If [$result  ≠  "OK"]

#Connection failed

Show Custom Dialog ["Error: " & $result]

Set Variable [$result; Value:MBS("SQL.FreeConnection"; $Connection)]

Halt Script

Else

#Create a query:

Set Variable [$Command; Value:MBS("SQL.NewCommand"; $Connection; "SELECT * FROM Server_Config where ServerName=:Name")]

#If you use parameters, you can fill them here

Set Variable [$r; Value:MBS("SQL.SetParamAsText"; $Command; "Name"; "MacMini")]

#Execute it

Set Variable [$result; Value:MBS("SQL.Execute"; $Command)]

If [$result  ≠ "OK"]

Set Field [MySQL Query::Result; $result]

Show Custom Dialog ["Error: " & $result]

Else

Set Variable [$lines; Value:""]

Set Variable [$fieldcount; Value:MBS("SQL.FieldCount"; $command)]

Loop

#call FetchNext to get the next record

Set Variable [$result; Value:MBS("SQL.FetchNext"; $Command)]

Exit Loop If [$result  ≠ 1]

Set Variable [$line; Value:""]

Set Variable [$i; Value:1]

Loop

#We query field names and values to show them later

Set Variable [$v; Value:MBS("SQL.GetFieldAsText"; $command; $i)]

Set Variable [$n; Value:MBS("SQL.GetFieldName"; $command; $i)]

Set Variable [$line; Value:$line &  $n & ": " & $v & ¶]

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

Exit Loop If [$i > $fieldCount]

End Loop

Set Variable [$lines; Value:$lines & ($line & ¶)]

End Loop

Set Variable [$lines; Value:$lines & ¶]

Show Custom Dialog ["Result from Query:"; $lines]

End If

#Cleanup

Set Variable [$result2; Value:MBS("SQL.FreeCommand"; $Command)]

End If

Set Variable [$result2; Value:MBS("SQL.FreeConnection"; $Connection)]

 
As you notice some database types like MySQL, PostgreSQL, DB2, Oracle, Firebird and others need a client library. We point the plugin to load the client library which must match the bit number from FileMaker or Xojo. Once we are connected, we can run several queries over the connnection and usually keep it open while the application does its work.

English MBS Plugin training in Netherlands

The people from FileMaker Developers Nederland organize regularly FileMaker meetings in Netherlands. They asked me to offer some insight into the MBS Plugin, so we invite to an MBS Event for Saturday 11th March 2017 to de Schakel, Utrecht:

Wat zou FileMaker zijn zonder de plugin van Monkeybread Software? Deze plugin biedt FileMaker ongekende uitbreidingsmogelijkheden voor een aanvaardbare prijs.

De dag wordt ingeleid en begeleid door Christian Schmitz, de maker van de plugin. Zijn nieuwe versie 7 omvat Inmiddels ruim 4400 functies verdeeld over 169 groepen. De functies zijn grotendeels Windows, Mac en FM Server compatible.

Tijdens de dag gaan we aan de slag met CURL (o.a. email, ftp), file-manipulaties, Restful API, SQL en functies die grappig en handig zijn.

Daarnaast zal Christian de verbeelding stimuleren door een vooruitblik te geven op nieuwe functies. Uiteraard is er gelegenheid voor vragen.

Voor een lunch wordt gezorgd, daarna is een borrel op eigen kosten.

Het evenement vindt plaats in Vleuten nabij Utrecht en is goed bereikbaar met auto (gratis parkeren) en openbaar vervoer. Om de onkosten te dekken vragen we voor deze Meetup €50,= excl BTW.

Deelnemers moeten eigen laptop meenemen en zelf zorgen voor installatie van de laatste versie van de MBS Plugin.

in English:

Where would FileMaker be without the plugin from MonkeyBread Software? This plugin offers an unprecedented array of functions for a very reasonable price.
Our MeetUp event will start with an introduction by Christian Schmitz, who created the plugin. The new version 7 offers an impressive 4400 functions, in 169 groups. Many of them are cross-platform and even support FileMaker Server.

During the day, we will get our hands on CURL (including e-mail communication, FTP), file and folder manipulation, use of the plugin for RESTful programming and SQL, among other things.
Christian will be around to answer questions and we hope he will also gives us a glimpse of future developments as well.

The Event will be held in Vleuten near Utrecht. The location is easily accessible by car and public transport. To cover the expenses, we charge a fee of €50,- pp. excl. VAT, which includes the lunch.
Participants are invited to bring their won laptop and take care of the installation of latest version of the plugin themselves.

This is an English speaking event and I hope to see a lot of people from Netherlands or areas around. Sign up on Meetup or contact the organizer Hans Erik Hazelhorst.

MBS FileMaker Plugin, version 7.1pr1

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

Archives

Jul 2024
Jun 2024
May 2024
Apr 2024
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