Computers,  FileMaker

Exporting RTF text from a FileMaker field

On one of the projects I was working on, I came across a problem were I had data to export that needed to be exported with the RTF formatting maintained.  I was trying to create an index with some bolding etc. applied.  After looking for plugin etc. to do this I came across a simple solution.  If you’re using FileMaker on a mac you can use applescript to do this. (it may also be possible on Windows –  I don’t know)

Basically, what I did is create a loop to go through my records.  Then essentially I copied the contents from the field and pasted them in my application.   In this case it was Pages.  (Note:  I tried to use inDesign but it doesn’t work with all RTF formatting.  Plus it crashed  a bunch as my record got bigger.)  Pages worked fabulously!  Over 2500 pages and no problems.
Export to RTF
Create a loop.
Copy (the field you’re store the RTF data in.
Run the applescript (see below)
Go to the next record.
Export to RTF Part 2

Here is the applescript code I used:
tell application “Pages”
   activate
document
end tell
 
tell application “System Events” to keystroke “v” using command down
Worked like a charm!  Just open up Pages with a blank record and run the FileMaker script.

Leave a Reply

Your email address will not be published. Required fields are marked *