I need a little help here. I have a database called “teste1.fp7” with a table called “table1” with a layout called “picstore” and finally a field called picture and i need to insert picture (BTW just store the reference) with a file (pic) that i have in this path “Tiger:Users:megaboss:Desktop:storepic:pic001.jpg” using applescript.
I’ve tried this one but i got errors.
tell application “FileMaker Developer”
set foo to “Tiger:Users:megaboss:Desktop:storepic:pic001.jpg”
set (value of cell “picture” of current record of table “table1” of layout “picstore”) to a reference to file foo
end tell
It doesn’t need (or want) the extra “reference to” clause. Setting a FileMaker container to a file is always “as a reference only.” In fact it’s difficult to completely “embed” a graphic unless you use some other tool (such GraphicImporter OSAX). Also, it’s “cellvalue” not plain “value”. But neither is needed in this case. This works:
tell application “FileMaker Developer”
set foo to “Tiger:Users:megaboss:Desktop:storepic:pic001.jpg”
set cell “picture” of current record of layout “picstore” to file foo
end tell
Also, layout alone specifies the table (occurrence); “table” is actually “table occurrence” (the boxes on the Relationship Graph, NOT the table names you defined in the Tables tab. Kind of misleading, but you wouldn’t want to have to type “table occurrence” in AppleScript). The Tables you define in the tab are actually “base tables.” Layout are assigned to table occurrences.
No, version 6 is much the same. Obviously don’t use any “table” references. Also, if it’s FileMaker Pro, don’t say “FileMaker Developer” (especially if you have both, one in 6, the other in 7).