To save space in FileMaker Pro when you attach images, you can click the “Reference to file only” box when you attach a picture to a container cell. But does anyone know if there’s a way to do this when you attach an image or picture using applescript? For instance the script below:
tell application "FileMaker Pro"
activate
tell database "Somepictures"
set filenameVar to get data of cell "filename" of current record
try
set data cell "Image" of current record to file filenameVar
on error
display dialog "Invalid filename!"
end try
end tell
end tell
will it be a reference or the actual data? Is there any way to tell in Filemake which way an image is attached?
I’ve looked over the boards and found nothing that explains this. This question has been asked before but never answered.
I believe by default FMP only uses a reference to the file when setting a container to an image via script. I am currently having problems with my Claris XTND translators but was able to test the difference between pasting an image in and setting it via script.
tell application "FileMaker Pro"
--manually paste pic from Pshop into cell
--now get the cell
set fee to cell "thepic" of current record of database "foo.fp5"
------>returns <<Picture>> (79k)
--now set the cell to a file
set foo to "Mac HD:Desktop Folder:my pic.jpg"
set cell "thepic" of current record of database "foo.fp5" to a reference to file foo
--now get the cell
set fee to cell "thepic" of current record of database "foo.fp5"
--returns "file Mac HD:Desktop Folder:my pic.jpg"
end tell
Also, after pasting an 88k jpeg into the field, and duplicating it 16 times, my DB size swelled to 816k. If I set the cell to the same pic via the above script, and duped the record 16 times, the DB size says at the original 16k.
Sorry - I cannot test using the “insert picture” function.