You'll need to use Export Field Contents. I know you'd rather not do that, but it's really your only option. What issues does that cause for your solution? (I may be able to suggest ways to mitigate them.)
Thank you PhilModJunk for your reply. My issues with exporting the container file are twofold:
1. Duplicate files. I want to avoid having duplicate files on the server, so I figured I could have the export files save to a temp folder that can be cleared out when the database is closed. I set up an AppleScript to delete all files in the temp folder that runs before the database closes, but the problem I run into is that if the user still has the file open, it will not be deleted from temp. Two possible solutions that I don't know exactly how to execute:
a. Force the files to close without involving the user. (preferred)
b. Create a custom dialog indicating that the files must be closed before the database can be closed with a pause until the user confirms that they have indeed closed all open exported files.
2. Filenames. I have a script tied to a button for the user to export and view the file. I am using the Export Field Contents script, specifying the appropriate target field. I run into an issue with specifying the output file, specifically with the filename. I'd like the user to be able to view as many files as they'd like, but it seems that I would need to specify each filename separately? Is there a way to tell FMP that I want the filename to be "filename +1" to create an infinite series?
Thank you for sharing your expertise. Your help is much appreciated.
1) If you are exporting to the user's temporary folder, you should not need an AppleScript to delete these files as they will be deleted automatically when the database is closed. As far as I know, if the user keeps the file open, closes the database and then later closes the file, this file still should not be retained in the temporary folder long term, but this is not a scenario that I have tested.
Option b should be possible if you use a system script or a file plug in to check for files in the temporary folder after clearing it.
2) There are several approaches for handling this issue. Export Field Contents can use a $Path variable to designate both the location and the file name of the file produced by Export Field Contents. This $Path can include a file name extracted via calculation from the container field and/or it can assign a calculated unique value such as the digits produced from Get ( CurrentTimeStamp ) or a global counting variable that you increment each time.
For more on container fields, the $Path variable and the script steps that can use them: Exploring the use of a $Path Variable in Scripts
Thank you for the information on the $Path variable. Your sample database helped immensely. I was able to get the files to export with the name they were imported with, which eliminates the duplicate filename problem.
I can't thank you enough.