Brian Dunning's FileMaker Custom Functions

OSAScript ( script )

performs an AppleScript from a calculation field

  Average rating: 3.9 (36 votes) Log in to vote

Peter Wagemans   Peter Wagemans - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
OSAScript ( script )
  Sample output:
result of your script

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Normally, you can only execute AppleScripts as script steps. The free shell plugin lets you pass the script to the system shell.
The only thing we have to do is quote the script string, remove the tabs, and prepend every line of code with "-e ".
Complex enough though to make a small custom function.

Try it when the field "myScript" has the following contents:

tell application "Finder"
set theFolderName to "Hello World!"
make new folder in desktop with properties {name:theFolderName}
end tell

Be careful not to send stuff to FileMaker itself, since it is busy calculating the formula. You could experiment with "ignoring application responses" to work around that.



Log in to post comments.


Note: these functions are not guaranteed or supported by Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 15 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: