Do you use FM15? I noticed it lies creation data of exported file as same as original file, on Windows.
Re: "I don't understand what the $filepath is doing I believe its a placeholder for my actual file path"—
$filepath is a variable which you should declare at the top of your export script. It needs to include all the relevant elements you see here in the example part of the Specify Output File dialog, which you will access under the Export Field Contents script step:
• The following path which I declared as the variable $exportFilepath, results in a file named TEST.pdf on my desktop: "filemac:" & Get ( DesktopPath ) & "TEST.pdf"
• As you can see, the first and last parts of the variable are hardcoded text, while the middle is a FM function. I suggest you experiment using Get ( DesktopPath ) to begin with, to help you understand, then maybe move to adding a folder to your desktop and adding that to your variable to make it one step more complex. Once you successfully achieve that you'll be well on your way.
• As you can also see, in the Specify Output File, all you need to enter is the name of the variable and FM will do the rest—as long as your variable is properly declared.
• The essential steps in your script are the following:
Set Variable [ $exportFilepath; Value:"filemac:" & Get ( DesktopPath ) & "TEST.pdf" ]
Export Field Contents [ TEST::containerTEST; “$exportFilepath” ]
Exit Script [ ]
In the first line you declare the variable
In the second line you specify the field to be exported and use the variable to set the export path, and the actual export takes place.
Those are the essential two steps which must be performed in that order. The script could of course do other stuff as well—for example, if you wanted to use it in a loop to export a series of files you would have to use FM functions, not hardcoding, to name your exported files (in fact it is better to do that in any case; I just used hardcoding for simplicity).
If you have FMAdvanced, I suggest you use the Debugger to step through the script with the Data Viewer open so that you can see what is happening at each step.
I typo, "creation date". Then I couldn't find the exported file some while, since I find latest file always.
Thank you for the great advice! With your help I got it to work. My new question would be how would I write this script to send the file to a folder on the desktop? would i use the "/" notation like on windows for example "get ( DesktopPath/testfolder ) " i am unsure how this would work since Get ( Desktop ) is a function of FM
1 of 1 people found this helpful
Get(DesktopPath) & "SomeFolder/"