The FileMaker Ninja's Toolbelt: TextMate Bundle

Posted by donovan 07/30/2011 at 05:30AM

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:

Custom function being defined in FileMaker calculation dialot

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
  • Commands
    • Manipulating/generating calculations
    • Manipulating/generating FileMaker clipboard XML
    • Extracting data from the DDR
    • Extracting data from import.log files
  • Syntax highlighting
    • FileMaker
    • 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!

Custom function being defined 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!

TextMate_Bundle_for_FileMaker_2012.01.09.zip

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!

- Donovan

Comments

Leave a comment

  1. Gemi about 16 hours later:

    This is good for that I work very difficult to edit these calculations in FileMaker Pro! I develop the Ruby On Rails where TextMate is the text editor that we prefer for most of development .

    Thank you Mr. Donovan!

  2. Olly Groves about 19 hours later:

    The Textmate Syntax highlighting ( asked dev to include recently ) now in Codebox code snippets app. http://www.shpakovski.com/codebox/

    Thanks for sharing.

  3. donovan 2 days later:

    @Gemi you’re welcome. Feel free to send me any code from the bundle that you decide to add or refine. The Ruby is a little rough still!

    @Olly Groves you’re welcome. Thanks for the heads up. Interesting app!

  4. Dennis Burnham 2 days later:

    This text editing feature should be built into FileMaker Advanced. That’s all I have to say.

  5. AndreasT 2 days later:

    I wish something like this was available for BBEdit.

  6. Daniel Shanahan 3 days later:

    Thanks, Donovan. This is a handy tool.

    A nice companion tool is QuickCursor (http://www.hogbaysoftware.com/products/quickcursor).

  7. donovan 3 days later:

    @Daniel What sort of things are you doing with QuickCursor? I’d probably use an OS level utility for most snippets if I was really dependent on them. I’ve heard praise for Hal Gumbert’s FMSnippets package for TextExpander.

    I’m a TextExpander guy myself. But I only use it for custom function headers, timestamping script notes and for storing complex script parameters.

  8. Anders Monsen 5 days later:

    Very nice - might finally tempt me to switch from BBEdit to TextMate.

  9. Olly Groves 7 days later:

    quick note: latest rev of codebox app (link above) has TextExpander function built in. Works great system wide inc in FMpro

  10. donovan 17 days later:

    Just updated the bundle download! Added a command or two and smoothed out some rough edges.

  11. fmc 4 months later:

    Is it worth asking about a FM-function-syntax-highlighting text editor on the Windows platform?

  12. Donovan 4 months later:

    @fmc, There are other text editors with similar features and feel, but the only one I’ve heard of that supports actual TextMate bundles like this one is E Text Editor. I haven’t tried it myself, so I’d love to hear if anyone has tried it.

  13. Tom 4 months later:

    I downloaded the trial of TextMake and also the filemaker bundle, which is now installed correctly. But I haven’t figured out how to have the filemaker custom formatting applied automatically to text that I’m editing. It just appears as regular text. Any advice is appreciated.

  14. Donovan 4 months later:

    @Tom, I have two screencasts recorded on how to format calculations in the bundle. There’s recently been some updates to that feature. I’m hoping to get the videos posted on Monday or Tuesday and will follow up with a link.

    In the meantime, it sounds to me like you’re working in a document whose language is set to “Plain Text”. You can see the language designation in the bottom of the window. Select that and change it to “FileMaker”.

    An easier way to do it is to use this service to pull the text into a new TextMate document for you. It will set the language to “FileMaker” for you.

  15. Tom 4 months later:

    Thanks for the quick reply! Setting the language to Filemaker was exactly what I was missing.