Search code examples
iosplistfilemaker

Filemaker: exporting a PLIST (for iOS)


I have a database which I want to export as an iOS compatible PLIST.

The work around I have come up with is to create a calculated field which adds the tagged padding and header and creates a report using these fields. I then export the preview of the report as a PDF, open the PDF in Acrobat Reader, select all text, copy and paste into XCode which recognises the PLIST format and all works as expected.

Is there a better way of doing this? (This seems a really convoluted way of doing things, high chance of error, etc.) The Export as XML option looks promising but I can't seem to join the dots.


Solution

  • Two ways that I can think of to do what you're trying to do. The most elegant way is probably the XML with XSLT export which you suggest. If you don't already know XSLT, though, you might try the following -- it sounds like with the calculated XML line you've already created, like this would be a simple change to your database:

    1. Create a single new global field, say outputXML
    2. Create a script, say plistCreator

    In the plistCreator script:

    1. Set outputXML to ""
    2. Go to the first record you want to export
    3. Loop through every record putting your calculated XML line into outputXML (set field outputXML to outputXML & ¶ & calculatedXMLLine)
    4. Go to next record, exit after last
    5. Export Field Contents (note that this is a different command than Export) for outputXML