Export Field Contents can be used to do that.
I tried doing that but when i tried to set the output path, i got an error message.
So basically the script was like this :
Set Variable[$path; Value:Get(Temporary Path)]
Export Field Contents[Model Database::Document file; "$path"; Automatically open]
BUt hten I get an error message of ""could not be created on this disk. Use a different name, make more room on the disk , unlock it or use a different disk.
What am I doing wrong?
You need a file name, something such as:
Set Variable[$path; Value:Get(Temporary Path) & "YourFile.jpg"]
And while I used jpg as the file extension, you'll need to use one consistent with the type of file in the container field. Take a look at this thread for more on using $Path variables: Exploring the use of a $Path Variable in Scripts
I tried the following script after what you mentioned
Set Variable[$path; Value:Get(Temporary Path) & Model Database::Document & ".doc"]
Export Field Contents[Model Database::Document; "$path"; Automatically open]
BUt then i got the error message The file "?" could not be opened. (Not Found)
It would appear that Model Database::Document is your container field. You cannot use it in the calcualtion for the file path variable like you have used it. You need either literal text, a text field or a calculation that returns text for the file name.
Please take a look at the link I provided earlier. There's a file you can download from that thread that includes a calculation for extracting the file name from a container field.
from my understand $path is a variable the contains the location of where the exported file should be exported to, right? so why does it matter what name I call it as long as there is a Get(Temporary Path) in it?
And do you know if htere is a way to retrieve the filename of the file that I have in the containerof Model Database::Document? I tried using the program that was in the link you sent me but that will only return to me the path of the temporary files in my computer for that particular file. I will be working with hundreds of records, if not thousands and it would be good if there was a way to get the path automatically. Also, multiple users will beu sing it so the temporary folder path will be unique as well.
I really am lost
The file path must include text for the file name. You can name that file anything you like so long as the file name is valid for your system's OS. You may note that my original example used quoted text for the file name.
Take a closer look at that demo file. There's a calculation field that returns just the file name of the file inserted into the container field. This calculation has been designed to return the file name for every possible insertion method/storage option except Insert Object--a method not available in Filemaker 12.
Thank you so much philmodjunk!!! you are a lifesaver!