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

TOC And Anchor Objects

Contributor ,
Feb 27, 2018 Feb 27, 2018

Copy link to clipboard

Copied

Hi Guys

Is it possible for the TOC tool to ignore anchor objects? Just bring the text, (pure text)...

TOC is created pushing text styles that you choose. To bring anchor objects it looks like strange.

Views

1.1K

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

correct answers 1 Correct answer

Community Expert , Feb 27, 2018 Feb 27, 2018

Hi Bob,

here a little code snippet that will remove all anchored frames from a selected text frame and its parent story ( in case the TOC is running through several text containers ) :

 

app.selection[0].parentStory.pageItems.everyItem().remove();

 

Written in ExtendScript (JavaScript).

How to save code and install a script:

Indiscripts :: Indiscripts for Dummies

 

Regards,
Uwe

Votes

Translate

Translate
Community Expert ,
Feb 27, 2018 Feb 27, 2018

Copy link to clipboard

Copied

The short answer is "no."

As far as InDesign is concerned an anchored object IS part of the text in the paragraph where it is anchored, so it must be included, but perhaps (I have not played with this, so I don't know) you can include a conditional text attribute on the anchored object and hide it in your TOC style.

If that fails to work, the old standby of making a duplicate, but non-printing, entry on your page, with a different style that is used for TOC instead of the one with the anchored object is one possible option. Another might be to put the anchored object into its own paragraph with a different style, but that would require it to be anchored as the first or last character in its current paragraph.

More info, perhaps a screen shot, will probably get you better advice.

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
Community Expert ,
Feb 27, 2018 Feb 27, 2018

Copy link to clipboard

Copied

I've had to work on a couple of projects like this and found the easiest method is to generate the TOC as the very last thing and then delete any anchored objects. If you do this all the time, you might want to pop over to the scripting forum and see if anyone can help with a script.

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
Community Expert ,
Feb 27, 2018 Feb 27, 2018

Copy link to clipboard

Copied

Hi Bob,

here a little code snippet that will remove all anchored frames from a selected text frame and its parent story ( in case the TOC is running through several text containers ) :

 

app.selection[0].parentStory.pageItems.everyItem().remove();

 

Written in ExtendScript (JavaScript).

How to save code and install a script:

Indiscripts :: Indiscripts for Dummies

 

Regards,
Uwe

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
Community Expert ,
Feb 27, 2018 Feb 27, 2018

Copy link to clipboard

Copied

That’s great. Thanks, Uwe!

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
Guide ,
Feb 27, 2018 Feb 27, 2018

Copy link to clipboard

Copied

Reminder:

TOC includes only inline anchored objects.

Custom position anchored object are ignored by TOC.

cutemag.gif

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
Guide ,
Feb 27, 2018 Feb 27, 2018

Copy link to clipboard

Copied

LATEST

Hi,

After having created the TOC a first time, just play this script to update … (the anchorings included in the TOC are all removed).

No need TOC text frame selection.

Dropbox - _FRIdNGE-0306_UpdateTOC.jsxbin

Best,

Michel, from FRIdNGE

["For free" script]

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