Skip to main content
Inspiring
June 25, 2025
Answered

Apply text formatting rule based on autonumbering value

  • June 25, 2025
  • 2 replies
  • 484 views

FM2017.0.6.798

Structured FM (not XML/Dita)

I have an element with autonumbering of <n+>. n is set to 1 at the start of the document.

 

I have a scenario where, when the autonumbering reaches a certain number, I want to change the numbering format, e.g. when the autonumbering reaches 20, I want to change the autonumbering formation to (Warning - High Count) <n+>.  I can't find a way to count the number of instances of the element itself, only the ancestors (of which there will always only be one in the whole document). All instances of the element is on the same level, so doing a level count doesn't work either. 

 

Is this possible?

 

    Correct answer frameexpert

    There is no way of doing this with stock FrameMaker. It could be done via scripting.

    2 replies

    Bob_Niland
    Community Expert
    Community Expert
    June 26, 2025

    This could be hacked by not using autonumbering as expected.
    You'd need a set of list mimic formats, relying on
    /Basic\ Next Paragraph Tag: [______]
    to advance the count by invoking a para with the next number.

     

    For a situation where, say 3 is maximum for a list, and 6 is a worst case scenario, you would have ¶formats named:
    Numbered.01, format [‹n=1›.\t], for which Next is:
    Numbered.02, format [‹n=2›.\t], for which Next is:
    Numbered.03, format [‹n=3›.\t], for which Next is:
    Numbered.w04, format [(Warning - High Count) ‹n=4›.\t], for which Next is:
    Numbered.w05, format [(Warning - High Count) ‹n=5›.\t], for which Next is:
    Numbered.w06, format [(Warning - High Count) ‹n=6›.\t], for which Next might be something unusual, perhaps just Body.

     

    This works, although I didn't explore how to get the prefix phrase italicized.

     

    The ‹…› above are not ASCII brackets, to prevent the forum engine from interpreting them. So don't copy&paste them.

    frameexpert
    Community Expert
    Community Expert
    June 26, 2025

    Bob, I don't think this will work with structured FrameMaker where the user is inserting elements instead of directly entering paragraphs.

    Matt-Tech Comm Tools
    Community Expert
    Community Expert
    June 27, 2025

    I think it would be possible with context rules using occurence indicators...{ } but I doubt it would be worth the lift for what Q's looking for.

     

    -Matt Sullivan, FrameMaker Course Creator, Author, Trainer, Consultant
    frameexpert
    Community Expert
    frameexpertCommunity ExpertCorrect answer
    Community Expert
    June 26, 2025

    There is no way of doing this with stock FrameMaker. It could be done via scripting.

    Inspiring
    June 26, 2025

    I suspected as much. I'm not familiar with scripting, so will need to manually manage this.

    frameexpert
    Community Expert
    Community Expert
    June 26, 2025

    If you can supply me a small, sample document with at least 21 of those elements, I may be able to write something for no charge.