Skip to main content
frameexpert
Community Expert
Community Expert
June 4, 2021
Question

Paragraph Unique properties not unique

  • June 4, 2021
  • 3 replies
  • 908 views

I have a crazy situation with ExtendScript and FrameMaker 2019. I have a table with a column of data that I am processing. When I query each cell.FirstPgf.Unique property for each cell in the column, they are all the same! If I generate an Alphabetical Paragraph List, all of the links go to the first cell in that column! Not cool at all.

This topic has been closed for replies.

3 replies

Inspiring
June 8, 2021

Some thoughts, which may or may not be useful:

  1. Just out of curiosity, what happens if you convert the table to paragraphs and query the resulting paragraphs? 
  2. Any chance of confusion between the actual table and the table format?
  3. Do you get parallel results looking at other properties?
  4. How much of the incorrect behavior can you duplicate from the user interface (without using a script)?

        --Lynne

frameexpert
Community Expert
Community Expert
June 8, 2021

Hi Lynne,

 

I didn't mess with 1 and 3, but as far as 4, I generated an Alphabetical Paragraph List using the paragraph format of the column in question. Sure enough, I got the correct paragraph content in the APL, but each link pointed to the same paragraph in the column, verifying the the Unique values were the same!

 

Because this was I job I quoted, I couldn't spend a lot of time fooling around with it, so I simply added Hypertext markers to the paragraphs to use as targets in my custom index.

 

Thanks for the feedback!

-Rick

frameexpert
Community Expert
Community Expert
June 8, 2021

FYI, I have been doing some fun scripting projects, generating custom lists and indexes, some with tables. Here is my methodology:

1) Collect the required data in an ExtendScript XML Object. Here is a simple example:

<?xml version='1.0' encoding='UTF-8'?>
<aml>
  <doc name="C:\DATA-10\Scripts\Komatsu\20210603-AML\A0190-001001.PC210LC11.000.fm" chapter="A">
    <entry id="1049959">
      <part>22U-01-21310</part>
      <page sort="3">A-3</page>
    </entry>
    <entry id="1049961">
      <part>203-01-51120</part>
      <page sort="3">A-3</page>
    </entry>
    <entry id="1049963">
      <part>01010-81020</part>
      <page sort="3">A-3</page>
    </entry>
...

I save the XML to a file.

2) I develop the template/DTD/RW rules, etc for the list/index. I create an XSL transformation to convert the XML file so that it matches my desired FrameMaker list/index structure. Here is a transformed snippet from the data above:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE aml PUBLIC "aml" "aml.dtd">
<aml>
   <entry>
      <link type="Hypertext"
            text="openObjectId H0120-001014.PC210LC11.000.fm:1 1053049"/>
      <part>01010-61030</part>
      <page>H-45</page>
      <link type="Hypertext"
            text="openObjectId H0120-001014.PC210LC11.000.fm:1 1053049"/>
   </entry>
   <entry>
      <link type="Hypertext"
            text="openObjectId N1210-003001.PC210LC11.000.fm:1 1054905"/>
      <part>01010-61450</part>
      <page>N-9</page>
      <link type="Hypertext"
            text="openObjectId N1210-003001.PC210LC11.000.fm:1 1054905"/>
   </entry>
   <entry>
      <link type="Hypertext"
            text="openObjectId N1210-006001.PC210LC11.000.fm:1 1049233"/>
      <part>01010-61450</part>
      <page>N-11</page>
      <link type="Hypertext"
            text="openObjectId N1210-006001.PC210LC11.000.fm:1 1049233"/>
   </entry>
...

3) I create a temporary structapps file as an XML Object that contains information about the structured list/index so it can be opened with FrameMaker. I found out that creating it as XML works without saving it as a binary FM document. I open it and read it into memory. Here is an example:

<?xml version='1.0' encoding='UTF-8'?>
<StructuredSetup>
  <Version/>
  <XMLApplication>
    <ApplicationName>aml</ApplicationName>
    <DOCTYPE>aml</DOCTYPE>
    <DTD>C:\Users\rick\AppData\Roaming\Adobe\FrameMaker\15\MyClient\KA_GenerateAML.dtd</DTD>
    <Template>C:\Users\rick\AppData\Roaming\Adobe\FrameMaker\15\MyClient\KA_GenerateAML_Template.fm</Template>
    <ReadWriteRules>C:\Users\rick\AppData\Roaming\Adobe\FrameMaker\15\MyClient\KA_GenerateAML_RW.fm</ReadWriteRules>
    <Entities>
      <Public>
        <PublicID>aml</PublicID>
        <FileName>C:\Users\rick\AppData\Roaming\Adobe\FrameMaker\15\MyClient\KA_GenerateAML.dtd</FileName>
      </Public>
    </Entities>
    <Stylesheets>
      <XSLTPreferences>
        <PreProcessing>
          <Stylesheet>C:\Users\rick\AppData\Roaming\Adobe\FrameMaker\15\MyClient\KA_GenerateAML.xsl</Stylesheet>
        </PreProcessing>
      </XSLTPreferences>
    </Stylesheets>
  </XMLApplication>
</StructuredSetup>

4) I open the XML file and the structured application converts it the fully-formatted list/index.

5) I read the user Structapps.fm back into memory to restore everything to the defaults.

 

Here is what I like about this methodology:

1) I can make complex structured lists/indexes from unstructured FrameMaker.

2) Creating and reading the temporary structured application XML file means that I don't have to install a custom structured application in the client's (or my) Structapps.fm file.

3) ExtendScript's XML Object is quite good and easy to read/write.

4) XSLT allows me to easily transform my data XML to the required finished XML without complicated ExtendScript code. An added bonus: I can make changes to the XSL and rerun the script without quitting/restarting FrameMaker.

 

Participating Frequently
June 8, 2021

Can you copy the table, paste a copy into the same doc, then delete the original table?

 

That should generate new UIDs for all of the objects.

frameexpert
Community Expert
Community Expert
June 8, 2021

Hi Dan. There are several hundred files and I suppose I could do it programmatically. Instead, I am inserting Hypertext markers into the target cells. It is not as convenient as just using openObjectId links to a unique paragraph number, but it works.

 

Actually, I just tried your suggestion and it didn't work. The pasted table has the same cell paragraph Unique values. I suspect that the engineers broke something somewhere along the way.

frameexpert
Community Expert
Community Expert
June 4, 2021

Same if I open it in FM 2020. Saving as MIF and reopening in FrameMaker doesn't change things.