OSAScript ( script )
performs an AppleScript from a calculation field
Average rating: 3.9 (36 votes) Log in to vote
Peter Wagemans - Show more from this author
Lesterius https://www.lesterius.com |
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.
Comments
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.