Passing a value from FileMaker Pro to an embedded AppleScript

What is the most straightforward way to pass a parameter from FileMaker Pro to an embedded AppleScript?

I’ve got a number of native FileMaker scripts doing various jobs and some of them have embedded AppleScripts (via FM’s Perform AppleScript command). I’d like to pass the contents of a FM layout field to that embedded AS script as a variable. Is this possible?

you’ll need to use FileMaker’s AppleScript dictionary to get the desired values from those AppleScript scripts.

Hi. If I understand correctly, normally it would be something like:

--inside FM
-- Note: field "theField" must be on layout "theLayout"

--tell app "filemaker pro" -- not needed when inside fm
tell window 1 -- current front window
tell layout "theLayout"
set theVariable to (get data cell "theField" of current record) -- get this field's contents only
end tell
end tell
--end tell
-- the variable theVariable now has the contents of field "theField" in it

1 Like

If I understand you correctly, I’m trying to pass a value from FileMaker within a FileMaker script into an embedded AppleScript, not the other way around.

Hmm let me try that – thanks!

Sorry it’s taken so long for me to reply but this worked, thanks! I just had to give the database extended privileges via fmextscriptaccess Security settings to get it to work.

1 Like