Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using field content as an export filename

Status
Not open for further replies.

jiroug

IS-IT--Management
May 28, 2006
3
US
I have an application which needs to export the contents of a field in each record. I am using the EXPORT FIELD CONTENT script step which is asking me to type in the name of the file to export the field contents too.

The file name is produced by a calculation field in the same application, which I am COPY-ing. How can I PASTE that in the filename and automate the export process completely?

Tks,
Jirayr
 
Can you give us more information about your way of working for the 'new file'.

I don't understand what you're trying to do or why....
 
I have created an application that takes information about newspaper articles each in a separate field (Title, subtitle, author, text etc.) then creates the code for an HTML page with that information. The HTML code is stored in a separation calculation field.
In order to generate the HTML file, I have a button that triggers a script using the EXPORT FIELD CONTENT script step. When the script is triggered, FMPro is asking me for a filename to store the field content into. If I type a name in that field and click on SAVE, everything is working fine.
I want to automate this last step. I have another field in the application that contains the filename of the HTML page. I want FMPRO to EXPORT the contents of the HTML code field into a file with the filename stored in the FILENAME field and I want to automate that process.
I hope this makes it clearer and thanks for the interest!
 
I'm not familiar with exporting data other than between databases or - warehouse....

The problem is you want it without dialog box....

So I would say: Plugin... or FM 8.

In FM8 you can export to a user specified file name using script variables.

But,if they're all saving in the same location then this won't work, but if you have them export to their own hard disk first (with the name hard coded in the FM script) then you can fire of a Send Message script step to rename the export to the name you specify (based on field data) and then move the file to where you want. All with command lines through Send Message.

It would be something like:

1. Export file to a fix place and name, like c:\expHTML.htm)
2. Make een batchfile with a rename or copy. :

@echo off
REN c:\expHTML.htm %1

3. Run a send message command where you call the batchfile, with parameter: location + yourFileName
The whole command should be in your calc field, something like:
"c:\renexp.bat "&<fieldWithFileName>&".htm")

Step 1 en 3 in a script.

Or you have to use a plug in.

But maybe a member with more 'export experience' can jump in.
 
jiroug,

If you are on version 8 you should be able to dynamically construct the export path. Take a look at a topic called "Creating file paths" in the Filemaker help file. It gives a good explanation of what is necessary to do. Be aware that you will have to use VARIABLES so become familiar with them while you are in the help file.

If you are on an earlier version, say v6 for instance, then you will have to use the method Jean described where you use Send Message to rename the file after it has been created.

-Striker
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top