Highlighted

Newbie question for creating new FM document and table.

Community Beginner ,
Jul 17, 2019

Copy link to clipboard

Copied

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

Adobe Community Professional
Correct answer by frameexpert | Adobe Community Professional

I am not sure, but I will add links to the other ones:

Newbie Question #1: Creating New Document

Newbie Question #2: Creating Tables

Newbie Question #3: Modifying Table Data

I have already submitted answers to the other threads.

TOPICS
Scripting

Views

208

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Newbie question for creating new FM document and table.

Community Beginner ,
Jul 17, 2019

Copy link to clipboard

Copied

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

Adobe Community Professional
Correct answer by frameexpert | Adobe Community Professional

I am not sure, but I will add links to the other ones:

Newbie Question #1: Creating New Document

Newbie Question #2: Creating Tables

Newbie Question #3: Modifying Table Data

I have already submitted answers to the other threads.

TOPICS
Scripting

Views

209

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 17, 2019 0
Adobe Community Professional ,
Jul 17, 2019

Copy link to clipboard

Copied

Hi Gene,

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.

Rick

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 17, 2019 0
Community Beginner ,
Jul 17, 2019

Copy link to clipboard

Copied

I did not think they were that complicated of questions and could be answered in a couple lines of code each.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 17, 2019 0
Adobe Community Professional ,
Jul 17, 2019

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 17, 2019 0
Community Beginner ,
Jul 17, 2019

Copy link to clipboard

Copied

No problem and thanks. I have already done as you suggested. One more thing, how do I "close" this thread?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 17, 2019 0
Adobe Community Professional ,
Jul 17, 2019

Copy link to clipboard

Copied

I am not sure, but I will add links to the other ones:

Newbie Question #1: Creating New Document

Newbie Question #2: Creating Tables

Newbie Question #3: Modifying Table Data

I have already submitted answers to the other threads.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 17, 2019 0