Moving FMP webpage to document

I have built a simple calculation that builds a webpage out of field contents in Filemaker Pro.

I need a way to save that text from one master calc field as an html document in a certain folder on my HD.

I image a script that puts contents of clipboard into a text file and appends with .html when saving would work just fine. Only, I don’t have that script.

Anyone have experiece with this?

I greatly appreciate any help you can pass my way!


First, if all you want to do is save the content of the field in a text file, you don’t need to use the clipboard at all (and shouldn’t use the clipboard if you can avoid it).

Something like this should get you started:

tell application "Filemaker Pro"
    -- adjust this line as necessary to get the cell contents
    set theHTML to contents of cell "calc_field_name" of current record as text
end tell

set outputFile to open for access file "Macintosh HD:path:to:output.html" with write permission
write theHTML to outputFile starting at 0
close access outputFile

Thank you for your reply,

However, I had trouble running the script…

I received the following error:

Applescript error:
Filemaker Pro got an error: Object is not an element or property of this class

Upon closing that error window I see that the first iteration of word "text’ in the script is highlighted.

The field is a text field in Filemaker Pro.
Also, I had troubling embedding as internal script in Filemaker Pro. Did only as a standalone script in Script Editor.

Any thoughts?