I know that you said that you didn't want to, but your best bet is to export it using export field contents. You can export the file to the user's temporary items folder so that the exported file is not retained on the user's computer.
Export Field Contents can be used to successfully open the file from the container field regardless of the storage and insertion options used to insert and store the file into the container field.
Go to Field [select/perform]
Can, in limited cases, be used to open a file in a container field. This is the scripted equivalent of double clicking the field. But this only works if the following conditions are true:
The container field on the current layout is not optimized for interactive content. (You can work around this with a second, hidden layout.)
The file was inserted with the insert file option.
The file was inserted with the "store a reference" option.
External storage is not specified for the container field.
I don't understand why this should be so difficult.
I have a container in my solution that hold references to PDF files. When I add the Path Name field to the layout, I can select the contents of the field, then hold down the command key and pop up a menu that reads "Open file://Macintosh/Users/..." When I choose that menu item, the file opens like magic.
What I have been unable to find so far is a way to pass that path to some Script function and then set a script trigger that opens the target file. If I could do this, then opening the PDF would be as easy as just clicking on the container field or some button.
What am I overlooking? I understand what you say about the "conditions are true", but the fact that I can so easily open the file from its path name, leads me to believe that I should be able do this rather easily.
Mac OS 10.6.8 / FileMaker Advanced 12 / Container data stored externally with Open Storage.
Try using Send Event with a $Path variable.
If you are having trouble working with $Path variables, this newly posted thread with a download link to a special tutorial file on $Path variables may be helpful: Exploring the use of a $Path Variable in Scripts