Skip navigation
divyanshm7
Currently Being Moderated

How do I handle Style Groups in InDesign Scripting?

May 2, 2013 11:50 PM

Tags: #indesign #scripting

Hi,

 

I am relatively new to InDesign scripting.

 

I'm trying to map Paragraph Styles to CSS, and it seemed to be working fine, till I came across Style Groups -

Styles belonging to a group are identified as - Root Style Group name : Child style group name : ...... : Style name


Because of this paragraph style  <Style name> was not mapping to the TOC style <Root Style Group name : Child style group name : ...... : Style name> and my TOC styles were not correctly mapping.

 

I wrote a fix for this in my app, by fetching parent groups and appending to a string - which i check in the TOC style entries.

 

Before calling this a FIX, I need to confirm if there are any more hierarchies/represnetations that could be used to represent a Paragraph Style as a TOC style? I don't want to see that a week later I discover something like <Style : Nested paragraph style> as a TOC style and then I'd have to fix my fix!

 

Thanks.

 
Replies
  • Currently Being Moderated
    May 3, 2013 3:51 AM   in reply to divyanshm7

    Moved from general discussions to the scripting forum...

     
    |
    Mark as:
  • Currently Being Moderated
    May 3, 2013 5:44 AM   in reply to divyanshm7

    Hi,

     

    If YourPara is a paragraph style in myDoc and defined inside group of styles named myStGroup

    you can refer to it using:

     

    myDoc.paragraphStyleGroups.item("myStGroup").paragraphStyles.item("YourPara");
    

     

    Jarek

     
    |
    Mark as:
  • Currently Being Moderated
    May 3, 2013 6:49 AM   in reply to divyanshm7

    Hi,

    TOC_style and para_style differ and you can not compare them.

     

    You could check if particular paraStyle is used as one of TOC_style or TOC_styleEntry properties, i.e.:

     

    tocStyle.titleStyle

    or

    tocStyleEntry.formatStyle

     

    A hierarchy of tocStyleEntries doesn't affect applied (used) paraStyle's names, I am preety sure.

     

    Jarek

     
    |
    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