With Troi File Plug-in 8.6 for FileMaker Pro you can easily add the icons of files on your disk to your FileMaker app.
To do this you use the TrFile_GetIcon function. It can create icons in sizes varying from 16x16 to 1024x1024 pixels and even with double resolution for retina screens.
You can get the icon like this:
Set Variable [ $Icon; TrFile_GetIcon( iconSwitches ; filePath ) ]
The TrFile_GetIcon function has 2 parameters: switches and the filepath of the file you want to get the icon of. With the switches parameter you can specify the size of the icon.
All you need is a simple script
A simplified “Get Icon from file path” script looks like this:
Set Variable [ $FilePath_forIcon; Get( ScriptParameter ) ]
Set Variable [ $Icon; TrFile_GetIcon( "-size=64" ; $FilePath_forIcon ) ]
Set Variable [ $ErrorCode; Value:GetAsText( $Icon ) // get a possible error code ]
#Check if there was an error:
If [ Left($ErrorCode ; 2) <> "$$" ]
#There is no error, clean it up:
Set Variable [ $ErrorCode; Value:0 ]
Else
Beep
Show Custom Dialog [ "An error occurred. Error code =" & $ErrorCode; “OK” ]
End If
#Save the results into your fields:
Set Field [ this::icon64x64; $Icon ]
Set Field [ this::gErrorCode; $ErrorCode ]
Exit Script [ Result: $ErrorCode ]
You supply the file path to the script as a script parameter, for example “C:\Data\Report.doc” on Windows or “Mac HD:Data:Report.doc on Mac OS X.
By integrating this script into your solution you can show the real file icons, providing your users with a rich experience.
In the download of the Troi File Plug-in you find the Thumbnail.fmp12 file with more example scripts:
Runs on Windows 10 and macOS Sierra
Troi File Plug-in runs on Windows 10, 8.1, 8 and 7 and is also compatible with macOS Sierra, Mac OS X 10.11 (El Capitan), up to 10.6.x (Snow Leopard).
You can use this version with FileMaker Pro 15, 14, 13 and 12.
Troi Text Plug-in 4 for FileMaker Pro helps you spell
The newly released Troi Text Plug-in 4 for #FileMaker Pro 14 adds customizable (or is it customisable?) spelling functions per field. You can implement this from a calculation, for example in a script or in a calculation field. You can also ignore, learn and unlearn words, from a script.
Can you parse out XML data in FileMaker Pro in one step?
If you regularly have to work with XML formatted data in FileMaker Pro®, getting the relevant parts of that data, and putting it into text fields can be a daunting task.
And you would probably say it is impossible to get a node of the XML out in one step as it would need a lot of script steps. But that is not the case if you use a plug-in.
Yes, it can be done!
It can be done if you install Troi Text Plug-in. This plug-in adds a function TrText_XML( ) to your arsenal of tools.
This function allows you to easily parse out a node from XML in one step! Here is the syntax of this function:
TrText_XML ("-GetNode" ; Node_to_get ; XML_data )
The function has three parameters: the first parameter specifies the action to take, in this case to get a node from the XML. The second parameter specifies which node you want to get. Finally the third parameter is the XML data you want to parse.
The result of the TrText_XML function will be the text of the node you are interested in. You can use this function in a script, for example in a Set Variable step.
You may not realize this, but you can also put this function in a calculation field: this will make the function recalculate automatically if one of the parameters changes, always giving the right result.
Defining the calculation field
Let’s make this concrete: assume your database already contains a text field XML_data, in which the XML formatted text is stored. You need to define three extra fields:
Node_to_get, text field
Node_data, a calculation field
Attribute_data, a calculation field (optionally, if you need attribute data)
In the field Node_to_get you can now specify the nodes and sub-nodes separated by a slash, like “main node/sub node/subsub node”.
Assume that in this example you are interested in this node path:
transaction/product/name
If you enter this node path in the Node_to_get field the TrText_XML function returns: “Super Plug-in”.
Not all XML data has attributes, but in this case it does, and in the Attribute_data field the attribute data “version=3.5” is returned.
And the advantage of this implementation is that it always works: when the XML_data field changes, the calculation will automatically update and the result will show correctly on the layout.
Play with the example and demo plug-in
The Troi Text Plug-in comes with multiple example files, which demonstrate the functionality of all functions of the plug-in. Below you can see the example file ParseXML.fmp12, with the data of our example:
If you have not done so already, you should download the fully functional demo version of the plug-in and play with it to see how easy it makes parsing XML.
More functions for FileMaker Pro 14
The TrText_XML function is just one of the functions added by Troi Text Plug-in. The plug-in also adds functions for manipulating 2 fields of data (AND/OR/XOR) and more. It is rewritten to support 64-bit and is compatible with FileMaker Pro 12 to FileMaker Pro 14.
On the Troi Text Plug-in page you can download a fully functional demo with all the functions explained here:
www.troi.com/software/textplugin.html
We are sure that this plug-in will speed up your work with text data.
If you want to meet FileMaker Plug-in makers in person: Troi Automatisering is going to the FileMaker Developer Conference in Las Vegas this year.
We will have a booth at the Product Showcase and hope to show you all the exiting new stuff we have with the Troi Plug-ins for FileMaker Pro. The FileMaker DevCon 2016 will be held July 18-21, 2016 at The Cosmopolitan of Las Vegas, Nevada.
We hope to see you there!
Today we released an updated version of Troi File Plug-in, our plug-in for manipulating external files and folders directly from FileMaker Pro. This is a maintenance update, which has a few bugfixes and improvements in the Search, GetDate and Metadata functions. Upgrading to version 8.0.1 is free for all users of version 8.0.
More info here: www.troi.com/software/fileplugin.html
Today we released Troi File Plug-in 8.0, which adds support for 64-bit architecture with FileMaker Pro 14. We rewrote the plug-in so the TrFile_SelectFileDialog, TrFile_SelectFolderDialog and TrFile_SaveFileDialog functions are now available for you to use too.
More info here: www.troi.com/software/fileplugin.html
Receive data from an external device in FileMaker Pro
With Troi Serial Plug-in you can receive data sent from an external device with a serial (RS232) interface in FileMaker Pro. You can have the plug-in start a script upon receiving in order to process the received data in your database.
Receiving the data
Assume you have an external serial device connected to a (virtual) serial port on your computer. You can use a serial-USB adapter to connect to a USB port on your computer, which will then act as a virtual serial port.
To receive data from this device, first open the (virtual) serial port on your computer using the Serial_Open function. Add this script step to a ScriptMaker script:
Set Variable[ $ErrorCode; Serial_Open( "-Unused"; "COM1"; ) ]
This will open the COM1 port.
Add this step to the script to start receiving data sent to the COM1 port using the Serial_Receive function:
Set Variable[ $Result, Serial_Receive( "-Unused" ; "COM1") ]
Troi Serial Plug-in buffers the incoming data. With every call to Serial_Receive all data from the buffer is retrieved. This might not be all data coming in. You might need to wait and append new data coming in at a later time.
Trigger a script to process the received data
To process the data and store it in your database, you can also set a script to trigger when data is received. You can do this in one go when opening the port with the Serial_Open function, like this:
Set Variable[$ErrorCode; Serial_Open( "-Unused" ; "COM1"; Get(FileName); "Process Data Received for COM1")]
This will open the COM1 port. When data comes in, the script "Process Data Received for COM1" in the current filename will be triggered. If you open more serial ports you can specify a different script for each port. In the triggered script you can then use the Serial_Receive function to read the data. Of course you can do much more in the script, like for example send reply data back with the Serial_Send function.
Multiple examples included
To get you started there are multiple example files demonstrating the use of Troi Serial Plug-in, like this one below:
Many more functions
This is just one of the functions added by Troi Serial Plug-in. On the Troi Serial Plug-in page you can download a fully functional demo with all the functions explained:
www.troi.com/software/serialplugin.html
It is a great and easy way to enhance your FileMaker database for you or your customers.
With Troi File Plug-in you can easily let a user select a file on disk, for example to get the contents into filemaker. With the plug-in you can also move or rename it, to indicate the file has been handled.
Selecting the file
Use the TrFile_SelectFileDialog function to open up a dialog which lets the user select a file. By default all the files can be selected. If you want the user to be able to select only files with a certain extension use the TrFile_SetDefaultType function first.
To let the user select any file add these script steps to a ScriptMaker script:
Set Variable [$DontCare; TrFile_SetDefaultType( "-Unused"; "")]
Set Variable [$FilePath; TrFile_SelectFileDialog( "-Unused" ; "Please select a file.") ]
This will return the path to the file for example:
To let the user select only files with the .txt extension modify these script steps as follows:
Set Variable [$DontCare; TrFile_SetDefaultType( "-Unused"; "Text files (*.txt)¶*.txt" ")]
Set Variable [$FilePath; TrFile_SelectFileDialog( "-Unused" ; "Please select a file.") ]
Now the user can only select .txt files.
Many more functions
This is just one of the functions added by the Troi File Plug-in. On the Troi File Plug-in page you can download a fully functional demo with all the functions explained:
www.troi.com/software/fileplugin.html
It is a great and easy way to enhance your database for you or your customers.
Rob Salusbury wrote to us that he is using our Troi URL plug-in to make FileMaker Pro into an incredibly powerful web client, in particular for communicating with SQL databases.
He thinks we are sitting on a real game changer that potential customers might not be aware of. Combined with Troi File and Troi Encryptor it delivers the ability to create very fast (VERY fast), very secure SQL applications that provide a ton of extended capabilities over any browser-only based solutions.
You can find the quote on our comments page.
The link below points to a page on his site that explains a little more about the concept.
http://customdataservices.net/sqlclients.htm.
We have to admit we don’t completely understand how this works, so you’ll have to quiz him on the details. We are amazed what our users can accomplish with the help of our plug-ins.
Many more functions
This is just one of the functionalities added by the Troi URL Plug-in. Another possibility is for example to send tweets to Twitter.
On the Troi URL Plug-in page you can download a fully functional demo with all the functions explained:
www.troi.com/software/urlplugin.html
It is a great and easy way to enhance your database for you or your customers.
With the recently released Troi Dialog Plug-in 6 for FileMaker Pro you can create very powerful Input Dialogs in a few script steps.
Below we show how to display an input dialog with a popup, which displays the values of a second value list, while returning the chosen value from the first list.
This (simplified) example uses fixed text to build the dialog, normally you would fill the dialog with data from your database. In ScriptMaker you need to add script steps to a script, but you can of course copy the script from the example files in the download of Troi Dialog Plug-in.
Implementing the InputDialog
First set the values for the popup. For this popup we fill the optional last parameter, which holds a second value list (with item names).
After the user has closed the dialog it will return the chosen button and the itemID chosen, so $Result will contain for example:
1|ST0002
This means that the user selected Pencil, which corresponds with itemID ST0002 and then clicked the OK button.
Much more functions
This is just one of the functions added by the Troi Dialog Plug-in. On the Troi Dialog Plug-in page you can download a fully functional demo with all the functions explained:
www.troi.com/software/dialogplugin.html
It is a great and easy way to enhance your database for you or your customers.
We just released Troi Dialog Plug-in 6.0, our plug-in for displaying flexible, dynamic dialogs in FileMaker Pro 13. This release adds several new features, such as the possibility to show items from a second value list in a pop-up while returning the value from the first, the possibility to choose multiple items from a list dialog and the use of several keyboard shortcuts in the edit fields of the InputDialog and BigInputDialog.
Download a demo here: http://www.troi.com/software/dialogplugin.html
Did you know that with Troi File Plug-in you can easily see which files or folders are in a folder?
You can get this list easily into FileMaker Pro with the TrFile_ListFolder( ) function. In ScriptMaker add this script step to a script:
Set Field [ result, TrFile_ListFolder( "-Files -Folders" ; "Mac HD:") ]
This will return a text list of all files and folders on the hard disk "Mac HD". The two switches -Files and -Folders indicate you want both types returned. This might return for example this:
Test.fmp12
Desktop Folder
Program files
Financial report.xls
and so on...
Troi plug-ins are cross-platform so you can also use it on Windows like this:
Set Field [ result, TrFile_ListFolder( "-Files" ; "C:\Data\") ]
This will return a list of all files (but not the folders) on the hard disk "C:\Data\".
Much more functions
This is just one of the functions added by the Troi File Plug-in. On the Troi File Plug-in page you can download a fully functional demo with all the functions explained:
www.troi.com/software/fileplugin.html
It is a great and easy way to enhance your database for you or your customers.
FileMaker is a powerful database, but it cannot do everything. Luckily you can extent FileMaker Pro with plug-ins. Troi Automatisering has been creating several plug-ins since 1995.