I recently posted the attached file as a proof-of-concept to the FileMaker Pro Users/Developers Facebook group. It is intended to demonstrate that you can dynamically create tables with specific fields and respective types using an XML import.
You define the new table in TableTemplate and its related fields (and types) are in related FieldTemplate records.
The Create Table script exports an XSLT style sheet which is stored in a global container field. Then it exports the related field definitions to <tablename>.xml, where <tablename> is the name of the table in TableTemplate, transforming the XML with the XSLT style sheet. Then the file imports the XML file to a New Table.
Here's the problem, and my question: if the Import Records step is set to Dialog OFF, the script throws an error, "No fields were selected for import", and creates a table called _filePath (the variable I stored the XML path is $filePath) with the desired fields properly defined. If the Import Records step is set to Dialog ON, you click OK and the table is properly created with properly defined fields.
I've tried adding a Pause Script step between the Export and Import steps but that didn't seem to help.
Any ideas? Is it the way the XSLT is structured? I'm a newbie with the XML/XSLT thing and this was as much about practicing that as it was about demonstrating this concept.