• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Selected TOC style Name

Enthusiast ,
Apr 04, 2014 Apr 04, 2014

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

Screen Shot 2014-04-05 at 10.46.11 AM.png

Very urgent request. Please help.

Thanks

Beginner_X

TOPICS
Scripting

Views

579

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 06, 2014 Apr 06, 2014

Copy link to clipboard

Copied

Hi All,

Gentle Remainder for my above request.

Please help on this ASAP.

Thanks

Beginner_X

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Apr 07, 2014 Apr 07, 2014

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Apr 07, 2014 Apr 07, 2014

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 07, 2014 Apr 07, 2014

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines