Moved from general discussions to the scripting forum...
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.