Newbie question for creating new FM document and table.
I have written a little jsx to extract data (mostly formats) from an existing Framemaker document and stored that data into multiple lists but am having all kinds of issues creating new data. How do I create a new document and table, load the list data into the table, and save out that table in a stand alone file. Nothing I tried from documentation and the net works like app.documents.add();. This language is just not clicking with me yet. Thanks in advance.
Example Only:
var hero = ['Superman', 'Spiderman', 'Wonder Woman'];
var fName = ['Clark', 'Peter', 'Diana'];
var lName = ['Kent', 'Parker', 'Prince'];
create a new document // var myDocument = app.documents.add(); does not work
create a table in the new document // new Table NewVar(tblVar) Format ("Format A") NumCols(3) HeaderRows(1) BodyRows(10) FooterRows(0);
add data so it looks like:

save document as .fm file
