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!
If YourPara is a paragraph style in myDoc and defined inside group of styles named myStGroup
you can refer to it using:
Actually, I'm reading a style and checking if it is a TOC style.
TOC style entries are made up in this hierarchical way while Parastyle is independent - as I had explained in the question.
So, before comparing i'm ensuring that I read the style group values too, append it with the parastyle value and then compare with TOC styles.
I just wanted to confirm if this is a complete fix, or am I still missing a case.
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.:
A hierarchy of tocStyleEntries doesn't affect applied (used) paraStyle's names, I am preety sure.