Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

export field contents to multiple files possible?

Featured Replies

  • Newbies

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!

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.

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

  • Author
  • Newbies

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""" & "

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

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.