I can't tell exactly what your screen shot is intended to show. Is this a calculation field set up to show the file path text found in a container field or the actual container field?
I'm not sure that I understand what you mean by:
I need to insert the file with only the Tree Health Management.pdf name in this case.
Do you mean that you need to insert a copy of the file rather than a reference to it? This is an option that you select for the Insert File script step.
Posting the actual script that you are using would also be helpful.
To post a script to the forum:
- You can upload a screen shot of your script by using the Upload an Image controls located just below Post a New Answer.
- You can print a script to a PDF, open the PDF and then select and copy the script as text from the opened PDF to your clipboard for pasting here. (with this approach, you can get multiple script steps on the same line, please edit the pasted text by inserting some returns to separate those steps.)
- If You have FileMaker Advanced, you can generate a database design report and copy the script as text from there.
- If you paste a text form of the script, you can use the Script Pretty box in the Known Bugs List database to paste a version that is single spaced and indented for a more professional and easier to read format.
The attached image shows both the script step to set the variable for the path and name and the insert file.
But is this all in one script or two scripts?
Do you get an error message when this script runs?
If this is two scripts, $file should be $$File to make it a global field that retains a value after the first script completes execution.
And I would just use:
Insert File [Business Clients RPT1::PDF ; $File]
rather than filewin:$File
Note in order for Insert File to successfully insert a a file into the field PDF, this field must be present on the current layout and accessible in Browse mode. Otherwise, the script step will fail to work. This is true of all script steps that start with "insert".
Phil, thanks for you help.
I needed to go to layout that held the field, not just be in the same table.