Skip to main content
VOR_DME
Participant
February 19, 2019
Question

Using find/change to remove text sometimes affects paragraph styles

  • February 19, 2019
  • 1 reply
  • 210 views

I'm using find/change methods in CS6 to remove large swaths of unwanted content in documents and it works well and fast.  Only one problem:  The applied paragraph style of some the remaining content changes to another paragraph style, which is undesired.   I want to maintain the existing paragraph styles of the remaining content, even as other content is deleted around it.

In my case, I'm removing content matching a given condition.

var myDoc = app.activeDocument;

app.findGrepPreferences = app.changeGrepPreferences = null; 

app.findGrepPreferences.appliedConditions = ['Content with this condition is removed']; 

myDoc.changeGrep();

I would greatly appreciate your suggestions for removing the content without affecting the applied paragraph styles of what remains.

Thanks,

Jon

This topic has been closed for replies.

1 reply

Community Expert
February 19, 2019

I think this is because you have applied the condition over the paragraph termination character as well, so when you remove the conditional text the paragraph return character is also removed and hence the style of the following paragraph is applied.

-Manan

-Manan