Highlighted

FindChangeByList | How to access a paragraph inside a folder

Participant ,
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.

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! 😄

Topics

How to, Scripting

Views

476

Likes

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

FindChangeByList | How to access a paragraph inside a folder

Participant ,
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.

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! 😄

Topics

How to, Scripting

Views

477

Likes

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
Adobe Community Professional ,
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

Likes

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
Reply
Loading...
Participant ,
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! 😄

Likes

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
Reply
Loading...
Adobe Community Professional ,
Apr 17, 2020

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...