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

Can I label a paragraph or ParagraphStyle using script?

Explorer ,
Sep 16, 2019 Sep 16, 2019

Copy link to clipboard

Copied

I have a script that takes docx files and pdfs and sets up a journal. I need to be able to label the documents when inserting them so that at the end of the inserts I can identify the page where the paragraph/file is.

TOPICS
Scripting

Views

811

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 ,
Sep 17, 2019 Sep 17, 2019

Copy link to clipboard

Copied

You can create a Table of Contents that includes the relevant Paragraph Style.

When you generate the TOC check Create PDF Bookmarks. Place the generated text on the pasteboard. You can now use the Bookmarks panel to navigate to the page(s) that contains the text in the relevant style.

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
Explorer ,
Sep 17, 2019 Sep 17, 2019

Copy link to clipboard

Copied

I can do it all via script, correct? I couldn't search very well, as almost all forum topics talking about it disappeared after the update.

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 ,
Sep 18, 2019 Sep 18, 2019

Copy link to clipboard

Copied

Hi Gabriel,

do you mean the ExtendScript methods insertLabel("key string", "value string") and extractLabel("key string") ?

Then the answer will be: No, text like characters, words or paragraphs cannot be labeled with that.

ParagraphStyles can be labeled. Graphic frames can be labeled. Even links can be labeled.

 

What you can do with text is you can index text.

But I don't know if that will help much.

 

Or you could apply character styles that have no visual effect if you do not applied character style for formatting reasons.

Or you could apply a unique property, a text formatting that is otherwise invisible* and that you could search for with Text Find/Change or GREP Find/Change and loop the results for the parentTextFrames array and look into the value of parentPage of all items of that array.

 

*perhaps underlineTint if there is no underline in the text.

 

Hm. You also could add Note objects.

But you cannot do this with footnotes.

 

Regards,

Uwe Laubender
( ACP )

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
Explorer ,
Sep 22, 2019 Sep 22, 2019

Copy link to clipboard

Copied

I needs to add unique string value for each and every paragraphs. Can you please suggest me the supporting property.

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 ,
Sep 23, 2019 Sep 23, 2019

Copy link to clipboard

Copied

Hi sreekarthikeyank,

as I already said before: You cannot add a label to text.

That includes all kinds of text. Also paragraphs.

 

Regards,
Uwe Laubender

( ACP )

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 ,
Sep 23, 2019 Sep 23, 2019

Copy link to clipboard

Copied

LATEST

You could use the XML features for structuring.

https://helpx.adobe.com/indesign/using/xml.html

 

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