4 Replies Latest reply on Jun 8, 2015 10:30 AM by rouelf_1

    Different output formats from Export Field Content in OS X and iOS.

    rouelf_1

      Title

      Different output formats from Export Field Content in OS X and iOS.

      Post

      An annoying occurrence:

       

      Script step Export Field Content in iOS creates a doc with: Unicode UTF-8 (with BOM) and Unix (LF). In OS X creates a doc with: Unicode UTF-16 (Little-Endian) and Classical Mac (CR).

       

      Is there a way to make this export doc have the same format, e.g. always UTF-8 (No Bom) and choose: Unix (LF), or Classical Mac (CR), or Windows (CRLF) as desired.

        • 1. Re: Different output formats from Export Field Content in OS X and iOS.
          FentonJones

          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.
          https://dl.dropboxusercontent.com/u/84482636/Export1Field.fmp12.zip

          * 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.

          • 2. Re: Different output formats from Export Field Content in OS X and iOS.
            rouelf_1

            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.

            • 3. Re: Different output formats from Export Field Content in OS X and iOS.
              FentonJones

              "$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)?"

              • 4. Re: Different output formats from Export Field Content in OS X and iOS.
                rouelf_1

                Fenton, as I said earlier, "remarkable". Thank you very much for the explanation.