Copy link to clipboard
Copied
Hi All,
Simple question for you...
How can I alert the selected TOC style name.
We are creating huge tool. Based on the selection Toc Style, we will process the multiple document.
For example I want to alert the Toc Style CCC(tick mark) name in this document.
Trying Code:
var myTocStyle = app.activeDocument.tocStyles.selectedIndex;
//~ var myTocStyle = app.activeDocument.tocStyles.item(-2); //Dont want this concept
Very urgent request. Please help.
Thanks
Beginner_X
Copy link to clipboard
Copied
Hi All,
Gentle Remainder for my above request.
Please help on this ASAP.
Thanks
Beginner_X
Copy link to clipboard
Copied
I'm having trouble understanding just what you're trying to do -- are you trying to "read" a value that the user chooses from a standard UI dialog? You can't do that.
It's been a while since I've tried any TOC work, but I recall it used to be difficult to work out which TOC Style went with which TOC.
Things might have improved since CS3 days. Can you say a little bit more about the process you're trying to serve here?
Dave
Copy link to clipboard
Copied
From:
myStory.storyType
you can determine that a story is a TOC, but how do you get from there to the TOC Style that was used to create said TOC?
This was the question that was bugging me back in CS3 days and I see no improvement in the CC object model. Stories don't have an associatedTOCStyle property. But maybe you can get at this by lateral thinking. If a story was created as a TOC then it has certain paragraph styles in it. If the TOC Styles are designed to have unique paragraph styles that identify the TOC Style, then you're home and dry. For example, you could have a ParagraphStyleGroup for each TOC Style and the name of that group could be the same as the name of the corresponding TOC Style.
Of course, this assumes you have control over the template for the project so that this relationship can be relied on. But given that, you can start with a text selection. Check the applied paragraph style, look at the name of its parent and bingo: there's the name of the TOC Style.
I'm not sure if this helps in your situation.
Dave
Copy link to clipboard
Copied
Hi Dave,
Thank you for your valuable reply.....
We also trying the same way, what you explain in the above thread.
Above thread should be very helpful information for me.
Any better solution is appreciable???
Thanks
Beginner_X