Convert FileMaker value lists to AppleScript expression

Passing values between FileMaker and AppleScript can be a pain. Sure, you can use a named field and table in FileMaker to do this, but if you (or someone else) ever changes either of the names your AppleScript routine breaks. So, even though its not the most efficient way to do things, for short routines I often prefer to use FIleMaker’s ability to run a “Calculated AppleScript” (i.e., compile and run a script from a calculated text).

Other than efficiency, one problem with this approach is that you need to convert data into an AppleScript expression. This custom function makes it a simple task to pass a values list from FileMaker to an AppleScript subroutine:

Here’s an excerpt from FileMaker script that shows how you might use this function:

 

If I pass the select file script the list of values “file ABC¶file XYZ¶lmnop” here’s the dialog I get from AppleScript:

select_file_dlog

 

Now you may be asking “…but how do I easily get the value of the user’s selection from the AppleScript dialog?”. For the answer to that you’ll have to wait for a later post.

 

Leave a Reply