I imagine you'd want to write your script, so that it knows you're on an OS X computer. If so, I've found a way to Export the data of a single Field [ not using Export Field Contents, which does not have options ], but using a scripted Export Records, with a File type of XML, with an XSL file (a very simple one). The first uses Export Field Contents, to send the XSL file to the "Filemaker temporary folder".* Then it can use it to use Export Records to export the data field, as XML, using that XSL file. The XSL can "output" as UTF-8, otherwise the XSL just returns the data of the XML file, without anything else (i.e., no XML); the file name (which you can rename in a script step, is just similar to "file name.txt").
[ Both the "export" script steps are using the same path to the temporary XSL file.]
This file has the script. It has 2 tables, as one is for the XSL text.
* The export of the XSL file can use Export Field Contents, because it can be UTF-16:
<?xml version="1.0" encoding="utf-16"?>
then output as UTF-8:
<xsl:output method="text" version="1.0" encoding="utf-8"/>
[ The script is just exporting to the Desktop. But you can change that to otherwise, as you any other FileMaker export.]
P.S. Added a "timestamp as number" to the file name; as before it would overwrite any existing export file. You'd likely what to add something better.
Thanks Fenton, that is remarkable. Trying to understand the relatively simple script. I don't understand how the second export, "Export Records", uses the "$tmp_path" since it does not appear to be referenced in the "Export Records" step.
"$tmp_path" (temporary folder path) is specified in the "Export Records" step. There is something special about an export using XML as the file type; which is that a 2nd dialog appears. You choose "XML" as the File Type, click "OK", and the 2nd dialog suddenly appears (in its place), asking you if you want to specify an XSL (with several options). The "$tmp_path" (Variable) was put into the (•) File option, Specify… dialog. Yes, it's more confusing than a "regular" Export ( I still wonder, "where do I put the XSL (and which option)?"
Fenton, as I said earlier, "remarkable". Thank you very much for the explanation.