Skip navigation
Currently Being Moderated

Autonumbering in Hex

May 8, 2012 5:32 AM

Is it possible to create a hexadecimal autonumber sequence with ExtendScripts?

 
Replies
  • Currently Being Moderated
    May 8, 2012 8:26 AM   in reply to Jason L-S

    You can't go beyond FrameMaker's built in autonumbering feature, which doesn't support hex sequences. However, using ExtendScript you can build a practical solution. Here is how I would do it:

     

    1) Initially tag the paragraphs with a standard <n+> autonumber sequence. This will give you the correct sequential arabic numbers to start with.

     

    2) Develop a "ConvertToHex" script that will look for paragraphs with the format you applied above. The script would read the current autonumber value (1, 2, 3, etc.), and then convert this number to its hex equivalent. Then you can do one of two things: You can substitute the autonumber building block with the appropriate hex value, or you can put the hex value at the beginning of the paragraph and turn off the autonumbering for the paragraph. (I prefer the second approach, because I don't like to have an override for each paragraph. However, you will have to use the first approach if you want to use the hex number by itself in a cross-reference or variable.) NOTE: You have to work backwards through the paragraphs in the document to avoid changing numbers of following paragraphs.

     

    3) Develop a reverse "RemoveHex" script that will restore the particular paragraph format back to arabic <n+> autonumbering. You will need this if you want to do further edits to the document or documents.

     

    So the basic workflow would be to work with the document with the <n+> building blocks in place. When you are ready to print (or PDF) for review or final output, you would run the "ConvertToHex" script. When you want to do edits or updates, you would run the "RemoveHex" script.

     

    I actually wrote a similar script for a client using FrameScript. But you certainly can use ExtendScript to do it as well. Please let me know if you have any questions or comments.

     

    Rick Quatro

     
    |
    Mark as:
  • Currently Being Moderated
    May 9, 2012 1:02 PM   in reply to Jason L-S

    Jason,

     

    FM's counters are hardwired to always increment by "1" (or next value) whenever the "+" operator is specified in the autonumber building block.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points