Are the inserted files inserted with "store by reference" or do the container fields store a physical copy of the file?
Sounds like physical copies of the file, but let me know if I'm wrong here.
With data physically stored in the container field, You'd open the file by using Export Field Contents and you can specify the field being imported using the Upper Specify button that comes with this script step. Then, this dialog should not appear.
(Export field contents also works with store by reference files, but these files can also be opened with a go to field [select/Perform] step.)
In my solutions, I've used a small button under the container field labeled "open". The button runs an Export Field Contents script, which is set to save the file to the users temporary file path then open the file.
Set Varialble $temppath [Get (TemporaryPath) & Substitute ( GetValue ( incoming::incoming;1 ) ; "file:" ; "" )
Export Field Contents [table::container; $temppath; Automatically open]
The files are saved as references. When I right click and select "Export Field Contents" it bring ups a dialogue that asks me for a place to Save the file. It brings up the location of where it's stored, but when I select a new place, like the Desktop I get this error that says it can not be found. What are the other options of opening the files?
From what PhilModJunk says I can "go to field [select/perform] step" but what does that mean?
Also, Mark Gores, can you walk me through this button set up? Thanks.
To set up the button you just need to make a little more rooom in your portal to give you room to put a button next to your container field.
You then need to write the open file script.
Set Varialble $temppath [Get (TemporaryPath) & Substitute ( GetValue ( incoming::incoming;1 ) ; "file:" ; "" ) //this may need to be adjusted to fit your system
Export Field Contents [table::container; $temppath; Automatically open] //substitue your container field for table::container
It may help to throw in a "Show Custom Dialog" set in there, setting the the message option to $temppath so you can see what you are getting for a value. Adjust the Set Variable step as necessary to go to the file you want. The Get TemporaryPath is usually a hidden folder so you may have to select show hidden in windows explorer or Finder to see it and make sure the file is getting saved there.
Set the button to "perform script" and select the open file script.
The other issue that you may come across is if the files are inserted as reference by someone else on the network. If that file is on thier computer, the reference will be the path on thier computer. Unless you have the same file in the same location on your computer, you will get the cannot be found error. The way I solved this is through another script that takes anything placed in the container file, exports it to a folder on the server, then re-inserts it self from that point. This ensures that all files placed in the containers are in a location that everyone on the network can get to. In that process I also modify the file name by adding the recordID from the container's table to prevent similar files from overwriting each other. This script can be set to run from a script trigger when the container field is modified so it automatically happens everytime someone inserts a file.
Go to Field is a script step you can use in place of export field contents. For Store by reference file, it will open the current copy without making a new copy like export field contents does. This is a more desirable option if your users might need to edit the opened document and then save it back to the original location so that the changes will appear the next time some one opens the file. It may also open the file a bit quicker since it doesn't have to make a copy of the file.
Store By Reference files can also be opened just by double clicking the field and no scripting is then required.
Ok, my files are stored by reference and the references are all in the same places and I do not have an illegal characters in the file names. Unfortunately, both the button and just double-clicking on the shortcuts do not open the files (clicking in the portal and in the original, related container field in the related table). I am using File Maker Pro 7 and this has only been occuring since updating to Adobe Reader X. Is this a compatibility issue? I realize I can go back to a different version of Adobe Reader, but is there a more permanent solution?
When posting a question and you aren't using the most recent version of FileMaker, please tell us or our advice may fail due to version differences.
I do not have a version of Filemaker 7 to test, but that could be why this is not working for you.
My apologies and that must be it. Thanks for all your help though!