Jump to content

This topic is 7385 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

I am exporting a container field that contains .pct file. The database contains approximately 1500 records and I want to automate an export of all the .pct files. So it is great now that we have this feature in 7 to export the contents of a container field. but does any body have a suggestion on how to automate this so that it names the file with, say the contents of a text field in the same record for instance?

Posted

Sure. Add a text field to the table, with the calculation, GetAsText (container_field). Export both.

  • Newbies
Posted

Am I missing something here? I want to Script the export. In other words to export field contents, go to next record export field contents and exit scrip after last. The problem I am having is the naming of the file so that it does not over write the last record exported. What I was wanting to do is name the .pct file with the contents of a text field So I can run the script and export all the .pct files nice and neatly named with their record ID. I do not want to have to be prompted to name each file as it is exported.

Posted

Oh--much clearer and much tougher. I tried using a script parameter to pass a file name to the Export Field Contents step, but that failed. Have to think about this a while...I feel your pain.

Posted

Renaming files is not something that FileMaker can do natively; maybe someday; but it would have to work cross-platform.

On PC's you could use either command line (I imagine) or the InsideScan plug-in. But on a Mac you can use AppleScript. It's still tricky. As you say, you must rename each export so it doesn't overwrite the first. And you must export to a known location where you have access; which is only a few places if you're on a network.

I've made an example file. You can try it. You may need some help.

ExportFile.zip

Posted

Another method would be the following: Export Field Contents to the same file each time--but before the next record, copy the file to another, one whose name would be based on the RecordID. The exact script step to copy the file still needs to be worked out--but should be feasible to do.

Posted

Yes, I figured this out. Make a batch file (called, say, cpbmp.bat) for your operating system (.bat in Windows). This will contain the one line: copy test.bmp %1

where test.bmp is the file name for the Export Field Contents step. Then, in the script, add a Send Event script step, specifying the calculation, like:

"d:/filemake/cpbmp.bat" & " " & "d:filemaketest" &Calctest2::record_number1,

where record_number1 is just the RecordID field. This will create test1, test2, etc. to separate your pictures. Tested. Works.

This topic is 7385 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.