Question

In a FileMaker Pro (v12) script I'm trying to use an Applescript to call a shell script to create an md5 hash of a passed in variable and set the result to a cell in my database. The variable $key_secret_utime is successfully being passed in and I'm am successfully getting a result from my shell script so all of that is just for context.

However, when I try to set the result to a cell in my database I get an "Object not found." error and "Unknown Error: -10006."

I'm pretty confused by the syntax of cells/fields database/document and what not so I'm sure I'm just making a simple error. What am I doing wrong?

Also, is there a better way to be doing all of this?

Here's my Perform Applescript script step:

"
set myData to \"" & $key_secret_utime & "\"¶
set cmd to \"echo \" & myData & \" | md5 -q\"¶
do shell script cmd¶
set cellName to \"rovi_md5_string\"¶
tell me¶
set data of cell cellName of current record to result¶
end tell
"
Was it helpful?

Solution

For one thing, make certain that your field rovi_md5_string is on the layout that you are on when you call the script.

Second, result is returning cellName, not the result of your shell script. Instead you can set a temporary variable to result below the do shell script line.

This worked for me when I had rovi_md5_string on a layout:

"
set myData to \"" & $key_secret_utime & "\"¶
set cmd to \"echo \" & myData & \" | md5 -q\"¶
do shell script cmd¶
set myResult to result¶
set cellName to \"rovi_md5_string\"¶
tell me¶
set data of cell cellName of current record to myResult¶
end tell
"

Take a look at my answer to this question for some thoughts on creating nice AppleScripts in FileMaker: How to pass data from a FileMaker field to an Applescript

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top