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

Autonumbering in Hex

Community Beginner ,
May 08, 2012 May 08, 2012

Copy link to clipboard

Copied

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

TOPICS
Scripting

Views

1.5K

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 ,
May 08, 2012 May 08, 2012

Copy link to clipboard

Copied

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

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 ,
May 09, 2012 May 09, 2012

Copy link to clipboard

Copied

Rick,

Thanks. Sounds like a well-thought-out approach.

Taking a step back, is is possible to create (without scripting) a new hex-based counter, for example <h>. So the autonumber format would look something like this: Register <h+>.\t

Where do those counters come from in the first place? Do users have any control over them by, say, editing the .ini file?

Take care,

Jason

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
LEGEND ,
May 09, 2012 May 09, 2012

Copy link to clipboard

Copied

Jason,

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

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 ,
May 09, 2012 May 09, 2012

Copy link to clipboard

Copied

LATEST

Arnis,

I understand that "+" increments the counter. I am asking whether it's possible to create a new building block. The building block would be a hexadecimal counter. So, for example, <h+>.

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