• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Newbie question for creating new FM document and table.

Community Beginner ,
Jul 17, 2019 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

TOPICS
Scripting

Views

375

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
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 17, 2019 Jul 17, 2019

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.

Votes

Translate

Translate
Community Expert ,
Jul 17, 2019 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

Votes

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
community guidelines
Community Beginner ,
Jul 17, 2019 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.

Votes

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
community guidelines
Community Expert ,
Jul 17, 2019 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.

Votes

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
community guidelines
Community Beginner ,
Jul 17, 2019 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?

Votes

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
community guidelines
Community Expert ,
Jul 17, 2019 Jul 17, 2019

Copy link to clipboard

Copied

LATEST

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.

Votes

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
community guidelines