Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

  • Newbies
Posted

Hi,

I need to export into multiple files (several thousands, xml-files for flash-application, one by one record).

"Export field contents" works fine within a loop, but it overwrites one and the same file over an over again.

Is there any chance I can control the export file's name by a field's content of the active record?

Any other solution at hand?

TX a lot!

Posted

You can use applescript to rename the files after you export them. Or, if you don't want to use applescript, you could use a plugin like the Troi file plugin to do the same thing.

Posted

The Mac UNIX foundation comes in handy here. You can use the Abstrakt.com shell plugin for this or the the applescript "do shell script" command.

Assuming you have a folder ExportFiles on your desktop this script exports a single record, put it inside a loop to export all records in the found set.

perform applescript

copy cell "filename" of current record to fileName

copy cell "ExportMe" of current record to exportMe

do shell script "echo " & quoted form of exportMe & " > ~/desktop/ExportFiles/" & quoted form of fileName

  • Newbies
Posted

Thanks a lot!

I first tried the troi plugin (3.0b2) and it worked, but unfortunately it does not seem to support utf-8 or utf-16.

AppleScript than did the trick for me -- I used the export field contents loop and had to add just a single row with "perform apple script" to rename the exported files. Works fast and smooth between FM and Finder, no timing problems. First time I used AppleScript.

The Apple Script is something like:

"tell application " & """Finder""" & "

Posted

Did you try the applescript method using the shell script as supplied? You don't need to use the export field command or rename the file afterward, it does the whole operation and can dynamically name and locate the files.

I have attached an example in FM6 format. The scripts have been updated to handle unicode text.

ExportByShell.zip

This topic is 7418 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.