Obtaining related field values in Filemaker?

Hi:

I’m in way over my head on this project which is writing an Applescript that exports images from Filemaker and moves them to a new folder structure and then updates Filemaker on where the image now lives and reimports the image (images are placed by reference only, not actually imported).

The guy who created the database has a main table layout called assets which is where all the actual records can be viewed individually.

He then has another table layout called placement which has a portal where you can select the name of the image, assign it a page value and there’s a boolean flag that says whether or not the image has been exported yet.

I can easily obtain everything that’s on the “assets” record layout, e.g.:

set recName to cell “asset_name” of record 1 of table “assets”

I’m not actually planning on using “record 1” – I’ll do a find all and loop through them with a repeat. However, the criteria to do the find is that boolean flag that’s sitting in the portal window. The portal is showing yet another layout called “asset_selection”

I’ve tried a bunch of things to see this field:

set exportFlag to cell “exported” of record 1 of table “placement”
set exportFlag to field “exported::asset_selection” of record 1 of table “placement”

and about a zillion variations on that theme with no luck. Any idea how I can access a related field that’s sititng in a portal window on a table layout?

(to recap, the related field is “exported::asset_selection” which is in a layout called asset_selection which is viewed in a portal window on a table layout called “placement”)

Thanks to anyone who’s read this far. Things were far simplier before Filemaker 7 and the use of tables.

–jon