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

FindChangeByList | How to access a paragraph inside a folder

Participant ,
Apr 07, 2020 Apr 07, 2020

Copy link to clipboard

Copied

Hello! 🙂

 

I've been trying to create a grep expression to use in "FindChangeByList".

 

Just to explain. I've a book with several texts and titles.

The titles usually start with: 

 

1 Title Here

Then the text comes next.

 

I want to find all sentences that start with a number e use in it a paragraph style that is inside one folder. How can I do that?

 

I've tried the following:

grep {findWhat:"^\\d"} {appliedParagraphStyle:app.activeDocument.paragraphStyleGroups.item(“TÍTULOS”).paragraphStyles.item(“título 2”)} {includeFootnotes:false, includeMasterPages:false, includeHiddenLayers:false, includeLockedLayersForFind:false}

 

But it doesn't work. 😞

Does some know how to solve it?

 

Thanks in advance.

TOPICS
How to , Scripting

Views

682

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

Participant , Apr 15, 2020 Apr 15, 2020

Thank you so much, Manan! 🙂

It didn't work the way you had said there, but I just made a small change at the script and now this is working perfectly.

 

Just in case someone else needs, this is how it's working for me:

 

grep	{fontStyle:"Italic"}	{appliedParagraphStyle:app.doScript('function getStyle() { var ps = app.activeDocument.allParagraphStyles; for(var i = 0; i < ps.length; i++) { if( ps[i].name == "Italic" ) { return ps[i]; } } } getStyle();', ScriptLanguage.javascript)}	{includeFootnotes:tr
...

Votes

Translate

Translate
Community Expert ,
Apr 07, 2020 Apr 07, 2020

Copy link to clipboard

Copied

Hi Maiane,

 

Have a look at the following thread where i have posted an example of how to use styles within folder with FindChangeByListScript

https://community.adobe.com/t5/indesign/findchangebylist-local-formatting-to-a-character-style/m-p/1...

 

-Manan

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
Participant ,
Apr 15, 2020 Apr 15, 2020

Copy link to clipboard

Copied

Thank you so much, Manan! 🙂

It didn't work the way you had said there, but I just made a small change at the script and now this is working perfectly.

 

Just in case someone else needs, this is how it's working for me:

 

grep	{fontStyle:"Italic"}	{appliedParagraphStyle:app.doScript('function getStyle() { var ps = app.activeDocument.allParagraphStyles; for(var i = 0; i < ps.length; i++) { if( ps[i].name == "Italic" ) { return ps[i]; } } } getStyle();', ScriptLanguage.javascript)}	{includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}

 

By the way, I didn't know we could include javascript inside this text file. I loved it! 😄

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 ,
Apr 17, 2020 Apr 17, 2020

Copy link to clipboard

Copied

LATEST

Hi Maiane,

 

Thanks for pointing that the code in my reply did not work, i have edited it. When we migrated from the old forum software to the new software, the code migration in threads was not perfect and things got wrongly ported to the new platform. Not my fault 🙂

 

-Manan

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