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 6. Dezember 2018 (auch 7. März 2019) können Sie in Hofheim am Taunus an einer eintägigen Schulung teilnehmen. Lernen Sie die über 5600 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 119 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.
Wir haben ein neues Video verfügbar:
MBS Plugin @ FileMaker Konferenz 2018
Präsentation von der FileMaker Konferenz 2018 in Malbun.
Ein Überblick was es neues in gibt im MBS FileMaker Plugin seit der letzten Konferenz, daher eventuell vorher das
FMK 2017 Video anschauen mit der Einführung.
Das ist meine eigene Aufzeichnung von meinem Vortrag bei der
FileMaker Konferenz in Malbun vom 18. Oktober 2018.
Wir haben ein neues Video verfügbar:
FileMaker mit Linux und SSH
Präsentation von der FileMaker Konferenz 2018 in Malbun.
Ein Überblick über SSH und was man damit in FileMaker machen kann.
Das ist meine eigene Aufzeichnung von meinem Vortrag bei der
FileMaker Konferenz in Malbun vom 20. Oktober 2018.
Am 20. November 2018 veranstaltet die Medio-Ingeno AG einen FileMaker Event in Meilen am Zürichsee:
FMnext Experience II
Zahlreiche FileMaker Vorträge am Abend, Empfang und einem unterhaltsames Special am Ende.
Bitte bald
anmelden, denn der Platz is begrenzt. Das Programm startet gegen 17:30 Uhr und der Eintritt kostet 50 CHF.
MBS Plugin Schulung
Wir bieten eine MBS Plugin Schulung für den gleichen Tag um ca. 9 Uhr im gleichen Hotel an. Für unsere Kunden haben wir ein Programm zusammengestellt speziell für die Anforderungen in der Schweiz:
- MBS Plugin Überblick für 2018.
- QRCodes für Schweizer Einzahlungsscheine nach ISO 20022.
- FileMaker Migration Tool
- MBS Shell Funktionen um das Tool zu automatisieren
- SmartCards auslesen am Beispiel der Schweizer Krankenversichertenkarte
- Audit Funktionen
- Word-Serienbriefe aus FileMaker
- Fragen & Antworten
Weitere Themenwünsche bitte baldmöglichst an mich schicken.
Kostenbeitrag: 150 CHF inkl. Mittagessen.
Anmeldung FMnext Experience II und
Anmeldung für MBS Schulung
New in this prerelease of version 8.5 of the MBS FileMaker Plugin:
Download at
monkeybreadsoftware.de/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder.
New in this prerelease of the 18.4 plugins:
- Updated ChartDirector control examples.
- Fixed bug in CDPieChartMBS class and setExplode method with HiDPI.
- Added delegates to documentation.
- Fixed SystemInformationMBS.UserName for Windows.
- Updated ChartDirector for Mac to newer build.
- Improved handling of extra quotes in CSV text for SplitCommaSeparatedValuesMBS function.
Download:
monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.
We got a new checkbox for remembering column widths for layouts, fields, tables and
new custom functions:
Coming soon in next 8.5 prerelease.
Der
Filemaker Stammtisch Rheinland findet an jedem 1. Dienstag im Monat um 19:00 Uhr statt.
Der nächste Termin ist der 6.11.2018.
Der Stammtisch findet in Bonn Beuel, im
Portofino, St. Augustiner Str. 129, statt.
Themen des nächsten Stammtischs:
Nutzung von Google Diensten wie Google Maps, Google Charts, Entfernungsberechnungen etc. mit Filemaker.
Anmeldungen bitte über das
Kontaktformular oder direkt per Mail.
PS: Der
Stammtisch Rhein-Main findet am
1.11.2018 wie gewohnt im Ristorante BELLA BARI in Wallau statt.
We got updated
ChartDirector control example projects for HiDPI and Xojo 2018r3 coming with next MBS Plugins:
When using our plugin, you can set
CDBaseChartMBS.ScaleFactor to 2 to get our plugin to multiply all numbers by 2 and get you a higher resolution of the graph. This makes it easy to adapt an application for higher resolutions.
We got recently a new function
Text.MergeFields to merge field values into a text block. This is useful for placeholders in a text sent by email. You just put a <<FirstName>> in the text, the plugin sees the << and >>, takes the text between and looks for a field matching the name. The function definition is:
MBS( "
Text.MergeFields"; Text; Flags )
We got a few flags to process. If Flags includes 1, we recognize field names. This can be a simple field name in the current table or a field from related tables with Table::Field notation using two colons.
Add 2 to Flags in order to allow variables. They need to start with one or two $ symbols. We evaluate the value and use it for the text. Variable names can contain spaces, but we don't recommend that.
Next add 4 to allow general expressions. This allows you to call all functions in MBS and other plugins as well as all FIleMaker functions. Great for using some Get functions, but if the user can change this themselves, they can do a lot of damage. If needed, we could maybe add a mode for only allowing Get functions? Let us know if you need that!
If you need values to be properly encoded as HTML or XML, you can get that by adding 16 for XML and 32 for HTML to the flags.
The new function is great for emails. You can have a template referencing fields and fill them when building the email. You could use fields from he current record of the customer you send newsletter to and put in some variables additional content to include. Please try it soon. Coming for version 8.5 and already in the
betas.
The new version of Xojo was released this week. You probably read the
announcement on the Xojo website. Improvements include Dark Mode (see
blog article) and IDE enhancements (see
blog article).
For MBS Plugin there is a little change we will apply to next plugin release: The list of data types for SQL in the Xojo plugin SDK was extended and now includes all variants of integer from 8 to 64-bit and signed/unsigned. We''ll update our
MBS Xojo SQL Plugin to make sure we can pass right data type to Xojo for UInt16 and others. The plugin will stay with old behavior for older Xojo versions.
This Xojo release looks great so far and we are moving a lot of projects from older versions to the new Xojo 2018r3 release. The labels on Windows are a big improvement as well as the other changes to reduce flicker on Windows. And the new Xojo version works with Xcode 10, which we need for MacOS 10.14 Mojave.
There is a move in software development to get us 64-bit only on Mac. We like to avoid the annoying dialogs for 32-bit for our customers and soon start implementing the notarization for our apps. There is an
AppWrapper update (3.9) coming to help there. But usually it will be a shell script to do the signing, the notarization and build a dmg. We want to automate the build process as much as possible.
For old Real Studio, it may come the time to say good bye. MacOS 10.15 may no longer support 32-bit and not run it.
See also review from Bob Keeney:
Xojo 2018 R3
Have you received PDF documents like this?
This is a PDF preview in Microsoft Edge. The PDF in question uses an OpenType font with postscript outlines with the variant without CID Font operators and this format is not supported by the Microsoft Edge PDF viewer.
For MacOS, the preview app shows the PDF, but when you print it, you get an empty paper.
We got a workaround for using this type of font with DynaPDF functions in our
FileMaker and
Xojo Plugins. So if you like to use such a font and get a working preview above, you need to not use the unicode encoding, but pick one of the 8-bit code pages like 1252.
Query the properties for font via
GetSysFontInfos (Xojo) or
DynaPDF.SysFontInfo (FileMaker) and check what you get back for BaseType. If the base type is OpenType. If it is open type and CIDOrdering property is empty, please don't use unicode code page for loading that font.
Or as I assume most clients do, is to trash the font and use one with proper character collection information. Otherwise having a checkbox to fall back to 1252 code page could be a checkbox to include for PDF output.
New in this prerelease of version 8.5 of the MBS FileMaker Plugin:
Download at
monkeybreadsoftware.de/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder.
New in this prerelease of the 18.4 plugins:
- Added SCNCameraMBS, SCNLightMBS and SCNCameraControllerMBS classes.
- Updated SQL Database plugin for changes in Xojo 2018r3.
- Deprecated Account types for ACAccountTypeMBS class as Apple deprecated them for MacOS 10.14.
- Changed SSH2TunnelMBS class to stop thread in destructor.
- Added ReadFile method to SmartCardMBS class to read data from various smartcards (e.g. Swiss Health Insurance Card or Belgian Identity Card).
- Added NSTextFinderMBS class.
- Added find bar methods with NSScrollViewMBS class.
- Added find bar methods with NSTextViewMBS class.
- Added NSColorSpaceMBS.File property.
- Added NSProcessInfoMBS.operationSystemVersion method and properties.
Download:
monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.
There is currently no direct way to tell SQL to use the current found set as condition for a query. But with the GetNthRecord function from FileMaker and the FM.Loop function in MBS FileMaker Plugin, we can build a list of IDs and generate automatically the SQL condition to use the found set.
The following line queries a list of IDs from current record:
MBS("FM.Loop"; "index"; 1; Get ( FoundCount ); 1; "GetNthRecord ( Contacts::ID ; index )")
As you see we define variable and count it from 1 up to the number of records in found set. For each loop iteration, GetNthRecord is called to query field named Contacts::ID and we get back the list of IDs like this:
2
3
5
6
7
8
We can change the calls to produce the right list for SQL with IN operator. We add some text before and after and replace the new line with the comma going between values. The new loop call looks like this:
"(ID in (" & substitute(MBS("FM.Loop"; "index"; 1; Get ( FoundCount ); 1; "GetNthRecord ( Contacts::ID ; index )"); ¶; ",") & "))"
The text returned may look like this: (ID in (2,3,5,6,7,8))
Please note that for UUIDs you may need to add quotes to get them in quotes, e.g. like this:
"(ID in '" & substitute(MBS("FM.Loop"; "index"; 1; Get ( FoundCount ); 1; "GetNthRecord ( Contacts::ID ; index )"); ¶; "', '") & "')"
The new list has quotes for the ID values: (ID in ('2', '3', '5', '6', '7', '8'))
Next we can build a SQL line using the IDs and query another field like the last name:
MBS("FM.ExecuteFileSQL"; ""; "SELECT \"Last\" FROM Contacts WHERE (\"ID\" in (2,3,5,6,7,8))")
As you see we put Last in extra quotes as last is a reserved value in SQL. In general it doesn't hurt to put all field and tablee names in quotes, so the SQL works for all names including those with spaces. The field used for ID may also need to be quoted and if you use UUIDs, please put values in single quotes.
One little check is required: Please make sure your found set is not empty before using this. Otherwise you end with an error message from FM.Loop or invalid SQL.
PS: With Command-Option-C you can copy expressions with color from the calculation dialog.
For the upcoming 8.5 release of the
MBS FileMaker Plugin, we got new functions to create a SSH tunnel from within FileMaker. You can connect to a server via SSH (IP or Domain), authenticate with your password or better your private key and start a tunnel to forward a connection from one side to the other.
This is great to for connect to MySQL server, which is not exposed to the internet. You connect to your web server via SSH and than forward port 3306 from your local machine to port 3306 on the remote machine. Once the tunnel runs, the
SQL functions in our plugin can connect through the tunnel to the remove database server.
For details, please see the
SSH.Tunnel.Run function to start the tunnel and
SSH.Tunnel.Messages to see debug messages. Please don't do anything with the SSH session while the tunnel is running. But you can of course run multiple SSH sessions in parallel to run shell commands or several tunnels.
We had this implemented earlier this year for Xojo (see
SSH2TunnelMBS class), but when I mentioned at the FileMaker conference that I have the code to do a tunnel, I was quickly asked to port this to the FileMaker plugin, so here it is.
In the last two weeks I worked on new functions to read smart cards. We got a client interested in reading
Belgian national identity card via
CryptoTokenKit functions in our plugins and a FileMaker client interested in reading
Swiss Health Insurance cards. We got both working with our latest MBS Plugins.
For testing, we used both the Smart Card Reader from König (left) and the SmartTerminal ST-1144UB from Cherry (right). Both do the job with a little difference. For the left device, you can connect and query status, even if there is no card. The right one only allows to connect when you have a card inserted. Other readers work probably as this uses a standard interface and drivers are built into the operation system.
For
Xojo we got the new
CryptoTokenKit classes in
MBS Xojo Mac64bit Plugin for the modern way Apple likes to handle this with asynchron operation and delegates. Beside this, we also go the older cross platform way via PCSC API and the ReadFile method in and
SmartCardMBS class.
For
FileMaker, we added a new
SmartCard.ReadFile function for Mac and Windows in the upcoming
MBS FileMaker Plugin version 8.5.
Whatever function you use, you can pass the right file ID and read the files you need from the smart cards. We also got a function to split the data into the parts. See
SmartCard.SplitValues for FileMaker and
SmartCardMBS.SplitValues function for Xojo.
Just in the middle of the seven FileMaker conferences in Europe. Three are done (Dutch, German and Italian) and three are to start this week (English, Spanish and French). And today the conference in Sweden started with over a hundred attendees:
Next I will travel to London for the English conference tomorrow after my
MBS Plugin session.
In the last week and the coming week, we have seven FileMaker conferences in Europe. Five are sponsored by Monkeybread Software. For three conferences, I will attend and present about our plugin.
We like to reward people coming to the conferences, so we make a special conference offer:
20% on all licenses including updates.
If you like to use that offer, just order via web store and use coupon code
FMK2018. Add first to shopping cart and than put the coupon code in the field.
Enjoy the conferences and see you soon!
Have you seen the MBS branded pocket knife?
For years people joked about MBS Plugin being the Swiss pocket knife for FileMaker (and Xojo), so we got a few pocket knifes to give away.
If you like, please visit our booth at the FileMaker Konferenz here in Malbun beside the gummy bears and pens:
As the blade is smaller than 6 cm, you can even take it home via airplane.
As you may know all Belgians have an identify card. We recently added classes for
CryptoTokenKit framework on Mac and translated a sample project from Swift to Xojo to read those card. Works very well to get basic information, address details and the picture of the person.
The same could have been done with our
SmartCard classes. And as those classes use the PCSC interface on MacOS, Windows and Linux you could even get it done cross platform.
But for newer development on MacOS Apple prefers to use their own frameworks, so we got the
CryptoTokenKit plugin part in the
Mac64bit plugin.
For Malbun we brought our usual posters and decorated a table with papers:
Please come by to say hello, get a pen, some gummy bears and the cool MBS pocket knife (okay for air travel).
The coupon code for our web shop with 20% off from all licenses is FMK2018 this year and valid til end of October.
Watch our
MBS Plugin presentation here from DevCon.
Diese Woche startet hier in Malbun, Liechtenstein die deutschsprachige FileMaker Konferenz mit Teilnehmern aus mindestens fünf Ländern. Ich hoffe ihr kommt nicht nur zur Konferenz, sondern nehmt euch auch einen extra Tag frei um die schöne Berglandschaft zu genießen.
Zu Fuß oder per Seilbahn kann man auf den Berg Sareis kommen und die Aussicht über das Tal genießen. Der Blick geht weit nach Österreich und die Schweiz rüber. Ab der Kapelle in Malbun kann man über den geschotterten Weg in ca. 4 km bis zum Café an der Bergspitze laufen mit moderater Steigung.
We are looking forward to two weeks with conferences. As you may know there are
seven FileMaker conferences this year in Europe.
I visit the German conference in Malbun (Liechtenstein), the Scandinavian conference in Gothenburg (Sweden) and the English conference in London (United Kingdom) this year. And for the German conference, Stefanie will join me to help on the booth and with our
training day on Wednesday.
See you there!
Greetings to the people in Gent, which start the
FM Summit today.
With last plugin release we enabled the option for CURL to disallow you passing user name and password. As URLs are sent to proxy and may be logged at the web servers, we prefer to not include credentials in the URL. And if you use the email address for user name, the name in the URL never worked.
So for the future, please separate them and put the credentials in the relevant options:
In
FileMaker:
Set Variable [ $curl ; Value: MBS("
CURL.New") ]
Set Variable [ $r ; Value: MBS("
CURL.SetOptionURL"; $curl; $URL) ]
Set Variable [ $r ; Value: MBS("
CURL.SetOptionUsername"; $curl; "xxx") ]
Set Variable [ $r ; Value: MBS("
CURL.SetOptionPassword"; $curl; "yyy") ]
In
Xojo:
dim curl as new
CURLSMBS
curl.OptionURL = URL
curl.OptionUserName = "xxx"
curl.OptionPassword = "yyy"
If you still use URLs with username and password, please move to passing them with the username and password properties.
If you really can't change your solution, you can still use
CURL.SetOptionDisallowUserNameInURL (FileMaker) and OptionDisallowUserNameInURL property in
CURLSMBS/
CURLNMBS and
CURLMBS classes (Xojo) to enable username and password in URLs.
New in this prerelease of the 18.4 plugins:
- Updated DynaPDF to version 4.0.24.62.
- Fixed issues with printer settings for DynaPDFMBS print methods on Windows.
- Improved RemoveAccentsMBS to include greece characters.
- Changed CDBaseChartMBS.MakeChartPicture to set resolution of picture to ScaleFactor * 72 dpi.
- Changed SQLDatabaseMBS to return RecordSet where you can query names of columns even if you have no rows.
- Fixed bug in PaletteCalculatorMBS.GetNearestIndexOfColor with color parameter.
- Fixed FinderUpdateMBS for 64-bit to work by calling internally NSWorkSpaceMBS.noteFileSystemChanged.
- Added more NSErrorMBS methods to create custom error objects.
- Fixed a bug to avoid crash with RegisterMBSPlugins with wrong license key.
- Fixed bug in SSL initialization introduced in pr1.
- Updated to zlib 1.2.11.
- Fixed bug in DynaPDF print functions (made white pages) and fixed example (printed only one page).
- Fixed bugs in WindowsMidiOutputMBS and WindowsMidiInputMBS for 64-bit.
- Fixed SystemInformationMBS.SystemFont for Mac.
- Added new plugin part to Mac64bit plugin for CryptoTokenKit from Apple.
- Fixed problem with SystemInformationMBS.Computername and MBS.ComputerName returning extra characters.
Download:
monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.
New in this prerelease of version 8.5 of the MBS FileMaker Plugin:
Download at
monkeybreadsoftware.de/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder.
FileMaker currently runs a promotion till 20th December 2018 where you can buy a FileMaker license and receive a second one to give to a friend.
in German here at
filemaker-magazin.de website.
In English here in the FileMaker Store:
store.filemaker.com/product/PMO
Please check conditions for details.
The CURL conference for 2019 is announced:
curl up 2019 will take place in Prague, the Czech Republic the last weekend of March.
When: March 29-31, 2019
Where: Prague, Czech Republic
Venue: Charles University
For details, please check the
website.
Maybe we can arrange some developer meeting with our Xojo and FileMaker clients, too?
Today a client sent me his email script using our plugin. It is based on one of our examples, but got quite a few enhancements.
First like with every professional developer, you see a few comments about what it does and where data is coming from. Also changes are logged at the end. Part of the standard setup of the methods is to disallow user abort and activate error capture to avoid error dialogs.
All the configuration details are not part of the script, but come from a configuration table. For tracing the soluton, a trace script is called to log what happens. Results from sending emails are stored in the table, so you can check for each email whether it worked and what the error message is. Please read the script below:
(more)
One of our clients asked how to add a Drag & Drop area on the layout to receive file drops.
Well, the obvious answer is to copy everything from DragTest Windows.fmp12 to their solution and enjoy it for both Mac & Windows. But it's not that simple as you need to know where to look. So here a step by step solution.
Before you start, please make sure you have a recent plugin version. The Drag & Drop features for Windows were introduced in MBS FileMaker Plugin 8.1, but we got bug fixes later, so best is to use current 8.4 release.
Add placeholder rectangle
First in our DragTest Windows.fmp12 file is a picture used for the drop area. The picture is there twice. Once assigned to the rectangle in the layout and second in a global field. So add the DropLogo field to the layout and you can export the image named "Drop-Files-Here-extra.jpg".
In your solution, you may find a layout where you like people to drop stuff. This should be a layout where you would enable Drop in one trigger and than disable it when the user leaves the layout.
To the layout, we add a rectangle area in the header for the drop. Our image is 500 x 224, so our rectangle should be 250 x 112 points big to use 2x image for sharp picture on high resolution screens. In the inspector for fill option, please select picture and select the image file. For the aspect ratio, please choose "Scale to Fit" below. In the first inspector tab, please give the rectangle a name, e.g. "drop".
Please add a global container image named DropLogo. Put it on the layout and import the image here, too. After the import, you can remove the global field from the layout. We need this image later in the script. It's a good idea to actually have two images, one of drop off and one for drop on. This way you can see whether the plugin is working.
Two scripts
Lets add the first two scripts. Please add an empty script named "FreeDrop" and one named "Setup Drop". The names can be different, but you must be consistent and later use the right names in the function calls. For the layout, please edit it and go to the Layout Setup dialog. There pick the SetupDrop script for the OnLayoutEnter trigger. Connect the FreeDrop script with the OnLayoutExit trigger. For debugging you may need to run them directly without trigger.
Lets start with the FreeDrop script:
If [ Length($$dropView) > 0 ]
Set Variable [ $result ; Value: MBS( "DragDrop.Release"; $$dropview) ]
Set Variable [ $$dropview ; Value: "" ]
End If
As you see we plan to keep the reference number for the drop area in the global variable $$dropView. If it is a number bigger than zero, we call DragDrop.Release function and free it. Than we clear the variable. With the If you can run the script several times without problems, e.g. call it before doing an action, which needs the drop area removed.
Now we add lines for the SetupDrop script. Don't type it, but please copy & paste from our example database. The script looks like this:
Set Variable [ $$dropview ; Value: MBS("DragDrop.CreateWithControl"; Get(WindowName); "drop") ]
Set Variable [ $result ; Value: MBS( "DragDrop.RegisterDropTypes"; $$dropview; "file") ]
Set Variable [ $result ; Value: MBS( "DragDrop.SetDragActionHandler"; $$dropview; Get ( FileName ); "DragAction") ]
Set Variable [ $result ; Value: MBS( "DragDrop.SetCursor"; $$dropview; 1) ]
Set Variable [ $result ; Value: MBS( "DragDrop.SetImage"; $$dropview; DragTest::DropLogo) ]
We start by creating a new drop area control. We pass in the name of the window. The plugin than looks in the window list to find it, so the name should be unique. With "drop" we specify for which layout object to look for. The plugin will query coordinates from FileMaker and try to place the control as good as possible over the existing layout object.
Next line we declare what we want to receive. This is usually file and only applies to Mac where we can choose between receiving text, pictures or file and get the right cursor. With DragDrop.SetDragActionHandler we define which script to call when something arrives. We pass current file name and the script name DragAction. We set the cursor to copy (value 1) and than set the image of the container field.
You can test this already. If you run the SetupDrop script, the image fo the drop area should change a bit to show the image from the global field. If you run FreeDrop script, it should revert back.
Fields
Our example needs the following fields. First a container field for the actual file data we receive. Than a text field for the file path or name to show to the user. And for our example we also have a description field to show how we got the file, but you don't need that.
So please add the container and text field to your database table or reuse existing fields there and change the following script.
DragAction Script
Here we have now the big script to handle the drops. The script has 4 sections. First a bit of setup to get the drop view ID from the script parameter and prepare the names list as variable with just an empty entry.:
Set Variable [ $dropview ; Value: Get(ScriptParameter) ]
Set Variable [ $names ; Value: ¶ ]
Second part accepts file paths dropped on our rectangle and imports the files. If we get a file path and the file is not yet here, we wait a second to the other application write it. Anyway we read file path and put file name in the names list. This way we can avoid duplicates if a file is provides two ways on Windows. Next we create a record and add the file as container value to the container field. The loop runs til all files are processed:
# Check for paths in Drag & Drop
Set Variable [ $count ; Value: MBS("DragDrop.GetPathCount"; $dropview) ]
If [ $count > 0 ]
Set Variable [ $index ; Value: 0 ]
Loop
Pause/Resume Script [ Duration (seconds): ,1 ]
Set Variable [ $path ; Value: MBS("DragDrop.GetPath"; $dropview; $index) ]
If [ Length ( $path ) > 0 ]
If [ MBS("Files.FileExists"; $path) = 0 ]
# File not yet written? Wait a bit
Pause/Resume Script [ Duration (seconds): 1 ]
End If
Set Variable [ $name ; Value: MBS( "Path.LastPathComponent"; $path) ]
Set Variable [ $names ; Value: $names & $name & ¶ ]
New Record/Request
Set Field [ DragTest::field ; MBS("Files.ReadFile"; $path; "auto") ]
Set Field [ DragTest::Text ; $path ]
Set Field [ DragTest::Description ; "Got via path list" ]
Commit Records/Requests [ With dialog: Off ]
End If
# next
Set Variable [ $index ; Value: $index+1 ]
Exit Loop If [ $index = $count ]
End Loop
End If
The third part of the script checks for file descriptors. The MBS plugin can receive promised file drops. For Mac, we convert them to real files for you and provide them with the path list above. For Windows we get file descriptor which describes the file. If you ask the plugin for size, path or data, the plugin will request the file and the data is transferred in memory without disk usage. The file descriptor may describe a file on disk or in memory, so we handle both in the script: Either we get a file path and read the file or we get it a container and put it in the field right away:
# Check for a file descriptor coming with Drag & Drop
Set Variable [ $count ; Value: MBS("DragDrop.GetFileDescriptorCount"; $dropview; "") ]
If [ $count > 0 ]
Set Variable [ $index ; Value: 0 ]
Loop
Pause/Resume Script [ Duration (seconds): ,1 ]
Set Variable [ $name ; Value: MBS("DragDrop.GetFileDescriptor"; $dropview; $index; "name") ]
Set Variable [ $data ; Value: MBS("DragDrop.GetFileDescriptor"; $dropview; $index; "data") ]
Set Variable [ $size ; Value: MBS("DragDrop.GetFileDescriptor"; $dropview; $index; "size") ]
Set Variable [ $path ; Value: MBS("DragDrop.GetFileDescriptor"; $dropview; $index; "path") ]
Set Variable [ $pos ; Value: Position ( $names; ¶ & $name & ¶; 1; 1) ]
If [ $pos = 0 ]
# not a duplicate
If [ Length ( $path ) > 0 ]
New Record/Request
Set Field [ DragTest::field ; MBS("Files.ReadFile"; $path; "auto") ]
Set Field [ DragTest::Description ; "Got via file descriptor with path" ]
Set Field [ DragTest::Text ; $path ]
Commit Records/Requests [ With dialog: Off ]
Else If [ $size > 0 ]
New Record/Request
Set Field [ DragTest::field ; $data ]
Set Field [ DragTest::Text ; $name ]
Set Field [ DragTest::Description ; "Got via file descriptor with data" ]
Commit Records/Requests [ With dialog: Off ]
End If
Set Variable [ $names ; Value: $names & $name & ¶ ]
End If
# next
Set Variable [ $index ; Value: $index+1 ]
Exit Loop If [ $index = $count ]
End Loop
End If
In the forth part, we check for a text drop:
# Check for text coming with Drag & Drop
Set Variable [ $text ; Value: MBS("DragDrop.GetText"; $dropview) ]
If [ Length($text) > 0 ]
New Record/Request
Set Field [ DragTest::Text ; $text ]
Set Field [ DragTest::Description ; "Got text" ]
Commit Records/Requests [ With dialog: Off ]
End If
With that script, we are done. Please enjoy and if you have questions, please don't hesitate to contact us.
As you know
MBS Xojo SQL Plugin can execute stored procedures. For that you normally just pass the name of the stored procedure instead of a SQL command. The plugin than queries the details for the stored procedure like the input and output parameters. You can set input parameters and call execute. After you got all the result sets read, the last data package from the server brings the return code and the output parameter values. Check this sample code:
(more)
As you may have seen the videos from FileMaker DevCon 2018 in Grapevine, Texas are planned to arrive soon.
The
DevCon 2018 sessions by track website shows 9th October 2018 as release dates for the videos.
New in this prerelease of the 18.4 plugins:
- Updated to LibXL 3.8.3.
- Removed draggingSourceOperationMaskForLocal events (deprecated in MacOS 10.7).
- Rebuild with Xcode 10. Minimum MacOS version is now 10.9.
- Added SetMethodPreference and SupportedAlgorithms methods to SSH2SessionMBS class.
- Updated SQLite to version 3.25.2.
- Added more methods for NSFileManagerMBS.
- Changed methods in NSFileManagerMBS to be regular ones, not shared. This is needed as we may have multiple file managers.
- Updated OpenSSL to version 1.1.1 for all targets.
- Added CipherMBS.CipherNames and DigestMBS.DigestNames functions.
- Added CipherNames and DigestNames to SSH2SessionMBS and CURLSMBS classes.
- improved DynaPDFMBS.PrintPDFPage to use DevMode data if set.
Download:
monkeybreadsoftware.com/xojo/download/plugin/Prerelease/.
Or ask us to be added to our shared Dropbox folder.
New in this prerelease of version 8.5 of the MBS FileMaker Plugin:
Download at
monkeybreadsoftware.de/filemaker/files/Prerelease/ or ask for being added to the dropbox shared folder.