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

Convert Table to Text

Community Beginner ,
Oct 10, 2012 Oct 10, 2012

I cannot find a method in the framemaker scripting guide for the Table > Convert to Paragraphs command.

I found a suspicious Fcode command: FCodes.KBD_TABLE_CONVERT. Not so great. I  neither like Fcodes, nor do think this would do what I want.

Advice?

Thanks,

Jason

TOPICS
Scripting
2.1K
Translate
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 ,
Oct 10, 2012 Oct 10, 2012

You basically have to loop through the table and write out the content to paragraphs the way you want them and then delete the table. I haven't found a way to access the actual Table > Convert to Paragraphs command.

Rick

Translate
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
New Here ,
Oct 16, 2012 Oct 16, 2012

Rick,

Do you have a code example to help get me started, to show how I would write out the content of the paragraphs?

I also thought I could use the Copy and Paste commands. I set the text range to the beginning paragraph and ending paragraph of a cell, then copy.

Then I set a new text range in the document where I want the text to go and paste.

But how do I then get the paragraph object(s) for each of those newly pasted paragraphs?

Thanks,

Jason

Translate
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
Advocate ,
Oct 19, 2012 Oct 19, 2012

Jason,

When you have copied the text range from the table cell, go to where you want to paste the materials, then insert a new paragraph, set the text location to the start of that new paragraph and paste. From the new paragraph, you should be able to find all new paragraphs as they are linked through their NextPgf properties. For each of the pasted paragraphs, apply the correct paragraph format (as it will probably be a table cell format and you will want to use some kind of body format instead.

Good luck

Jang

Translate
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 ,
Oct 30, 2015 Oct 30, 2015

The following code should do exactly what you want:

---

FCodesList = new Array(FCodes.KBD_TABLE_CONVERT,  FCodes.START_DIALOG, FCodes.KBD_RETURN, FCodes.END_DIALOG ); // Build List of FCodes

FCodes(FcodesList); //Execute FCodes

---

The trick is to use FCodes.START_DIALOG and FCodes.END_DIALOG codes, because otherwise the confirmation of the Convert to Paragraph dialog with Enter (KBD_RETURN) does not work.

Translate
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 ,
Oct 30, 2015 Oct 30, 2015

As far as I can see, the FCodes for dialog boxes don't work with Windows FrameMaker. If you look at the FDK Programmer's Guide, around page 270, there is a section called "Simulating user input". It says,

IMPORTANT: F_ApiFcodes() does not work with dialog boxes on Windows.

I just tried it and the same is true with the ExtendScript Fcodes method.

Translate
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 ,
Oct 31, 2015 Oct 31, 2015

ExtendScript of the Week: Keyboard Simulation in FrameMaker via Fcodes – TechComm Central by Adobe

shows that FCode sequences work in dialogs too, it's just that the code for the tab key is, totally counterintuitively, FCodes.KBD_ItemNextLogical instead of FCodes.KBD_TAB, which one might have guessed.

Translate
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
New Here ,
Jul 19, 2017 Jul 19, 2017

Is there anyway I can accomplish the opposite using Fcodes? I want to convert selected paragraphs to a table. If this is not possible, Is there a command to simply open the "Convert to Table" dialog box in FrameMaker?

Translate
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 19, 2017 Jul 19, 2017

Fcodes ([Fcodes.KBD_TABLE_CONVERT]);

Translate
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
New Here ,
Jul 20, 2017 Jul 20, 2017
LATEST

Thank you!

Translate
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