You need the complete file path to the file not just it's name. Otherwise, filemaker can't figure out where to find the file.
Try this to figure out file paths on your particular OS:
Insert a picture by reference into a container field, let's call it "Picture".
Define a calculation field to return text and enter the container field's name: Picture
Place both fields side by side on your layout. Re-size the calculation field so that it can display 3 or more lines of text. Insert a picture by reference into Picture and see what appears in the calculation field--which will be the path to that picture's file in the format filemaker expects you to insert into the container field.
PS. Insert text isn't generally the best script step for puting data in a field except for certain specialized uses. Set Field is a better option for doing this in your script.
I thought I'd replied to your post, but I didn't see it in the thread, so here it is again:
I was able to use your trick to get a file path reported.....but.....
--which will be the path to that picture's file in the format filemaker expects you to insert into the container field.
I'm not sure how or where to insert this path into the container field.
You have to figure out an expression that works for your script. The details depend on what you are trying to do.
The trick I mention, simply shows you what such a path would look like for your computer. You can use that as a guide in constructing an expression that works.
Working from my own sample file where I first tested this, I insert a picture from one of my folders and see that the last section of the calculation field displays the path to my inserted picture:
imagewin:/C:/Documents and Settings/Phil/My Documents/My Pictures/Farm Pict.jpg
I can use that in my script to insert a reference to any file in the My Pictures directory if I know the file name and enter it in the filename field I defined:
Set Field[MyTable::ContainerField; "imagewin:/C:/Documents and Settings/Jeff/My Documents/My Pictures/" & MyTable::filenameField]
Thanks for your response yesterday. To be clear on my intent:
I wish to create a script that will populate (or 'place') a jpg (or pdf) of a certain drawing on a record in the Quotes layout. So, if my client needs a quote for a Dust Devil, the quote (when emailed to him) needs to have this drawing visible, as well as some other information.
Here is the script I created based on your instructions:
Set Field [Quotes::Booth Isometric; "filemac:/Macintosh HD/Users/andrewbaca/Desktop/" & Quotes::Picture File Path
The field above <Quotes::Booth Isometric> is a container field placed on the 'spot' where I'd like the photo to appear.
The field above <Quotes::Picture File Path> is a calculation field where the path of the file was reported to me.
When I try to add a <]> at the end of the last field, like in your example, I get an error message "an operator (e.g. +,-,*,...) is expected here."
I should also report that the result of running this script places the icon of the image in the container field, not the image itself.
What am I missing? (probably a lot!)
Many new users get confused the first time they try to add Set Field to a script. See the following link for step by step instructions: (Scroll down towards the end of the thread.)
Selecting an "All" option with checkboxes
Did you ever find a fix for this?
See the link I posted.