Snippets Table of Contents | About Snippets | Faughnan Home Page
FileMaker Pro (Mac) can use AppleScript to move data into another Macintosh application, such as a text editor. This is the only way I've found to output save the contents of a single FileMaker field as a file on disk. I copy the contents of a FileMaker record, then paste the text into a text editor, and save the result as text file. I can do this for all records in a file.
This is a simple process, but there's one critical step. It is essential to activate the destination application, then do the paste operation, then activate FileMaker before doing another copy operation. If you fail to activate FileMaker, then FileMaker's internal clipboard will change, but the external system clipboard will not. Figuring this out was painful, I'm indebeted to Martin Trautmann for telling me how to do this.
If you'd like to dissect a FM Pro database that exports to HTML, you can download my snippets.fp3 database.
The following AppleScript code shows how this works. (Note: If you need quotes anywhere in FileMaker field, you need to use a quote as an escape character, as in "")
(the copy operation is done before this section using FileMaker's internal scripting commands)
tell application "Scriptable Text Editor"
make new document at beginning
save document 1 in file "Woofer:Work:WWW:Dragon:Snippets:" &
FileNameOut as text
close document 1 saving no
tell application "FileMaker Pro"
Confidence (1 to 3): 3. Date Created: 2/19/97. Last Revised: 6/11/97. Expires: . Language: english. Domain: .world. ID: 5. Topic: computer. Subtopic: Macintosh. Keywords: programming, application, AppleScript, FMPro, FMP3, FP3, clipboard, system, exchange.