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.
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
I would suggest that you break this question into tasks and post a question for each one:
1) How do I create a new document? Do you want a blank, portrait document, or do you want to create a document based on a template.
2) How do I add a table to a document?
3) How do I navigate a table and add data to it?
It's usually easier to get answers this way. Thanks.
I did not think they were that complicated of questions and could be answered in a couple lines of code each.
Everything is more complicated than you think :-). Plus, if you limit each question to a specific task, you help others that may need to do just one of the tasks.
No problem and thanks. I have already done as you suggested. One more thing, how do I "close" this thread?