Welcome to the first installment of The FileMaker Ninja's Toolbelt, an occasional series on various tools and techniques for taking your development in FileMaker to the next level.
Beyond the Calculation Dialog
The calculation dialog in FileMaker Pro is great for many things. It provides easy access to all of your fields, operators and functions. The Data Viewer in FileMaker Pro Advanced even shows you the calculation results.
Here's a screenshot of a custom function being defined in FileMaker Pro's native dialog:
But sometimes this can be cumbersome. The calculation dialog doesn't help format your functions and can be difficult to scroll through. Those of you who work in text editors know what I'm talking about. Text editors commonly provide users with a host of powerful features: syntax highlighting, code folding, easy indendation, code snippets, find and replace (even with regular expressions), and so on. That's why I develop my custom functions in a text editor whenever I can.
A Text Editor that supports FileMaker Pro?
The problem is that there aren't any text editors that support FileMaker calculations. Or are there? Those of you who already use TextMate might be a step ahead here. TextMate is a very popular text editor for Mac OS X. Best of all, you can easily teach it how to work with FileMaker calculations by installing a FileMaker "bundle" (similar to a plug-in).
There has been at least one bundle available that supports FileMaker. Charles Ross posted one to Google Code back in 2009. At some point Jonathan Stark added some snippets. Matt Petrowsky later posted a trimmed-down version of that to github. Those versions provided some helpful features:
- Syntax highlighting
- Code snippets
- Command for viewing function documentation
Very useful! I forked a copy of Matt Petrowsky's bundle back in March of 2010. I found it so useful that I have been gradually adding to it ever since. Here's a list of the current features:
- Tab triggers for FileMaker functions
- Documentation for functions, script steps and error codes
- Manipulating/generating calculations
- Manipulating/generating FileMaker clipboard XML
- Extracting data from the DDR
- Extracting data from import.log files
- FileMaker Clipboard
- FileMaker Log
- FileMaker Hash (Generated using #( ) custom function from six.fried.rice)
- Code folding
- Help section
This is what it could look like when working with the same custom function, but in TextMate!
Much more readable, isn't it? You can even change and customize the theme of this window to your exact color preferences. But that's just the start.
You can see it in action by watching this video: TextMate Bundle for FileMaker 01: Basics
Getting It For Yourself
Interested yet? Pretty powerful stuff! The bundle is available to anyone. All you need is a copy of TextMate and to download the files. TextMate even offers a free 30-day trial. You can download the current files and view installation instructions here.
Alternatively, you can just download a recent copy of the bundle below. Just extract the filemaker.tmbundle package from the .zip file and double-click on it. TextMate will take care of the rest!
Have you tried this bundle or something similar? Let me know on github or in the comments here. I'd love to make this an even richer community effort and resource!