Hi,
I am trying to use Applescript to read the contents of related fields in FileMaker 4.1. Say the master file is called “myMasterFile.fp4” and the related file is called “myRelatedFile.fp4” and the field that contains the related data is called “myField” in both the master file and the related file. I want to get all the fields of the current “found set” in FileMaker, so I’ve been trying:
tell app "FileMaker Pro"
set theData to field "myRelatedFile::myField" of document "myMasterFile.fp4"
end tell
But it comes back with an error saying “Object not found”. It does work to get data from a non-related field to just say:
tell app "FileMaker Pro"
set theData2 to field "myField2" of document "myMasterFile.fp4"
end tell
My example should get the value for a single record. When I run your first example, the result is a list with the field’s value for each record in the found set.
Hmmm,
That still doesn’t work on my FMP 4.1 running on MacOS9.1.(Maybe it is time to do some upgrading?) Also, I was actually trying to get a list of items for the field in the “found set” as in the first example - if it would only work.
As much as I hated to do it, I just fired up FMP 4 in OS 9. The scripts fail for me too. If I recall correctly, FMP 4 was the first version to offer relational databases. It’s possible that the scripting wasn’t up to snuff until later. If you don’t plan to upgrade, you might need to get creative and obtain the key field value from the master file and then grab the value from the related file.