Copy link to clipboard
Copied
Hi,
I need to remove extra enter mark in my Indesign file, at the same time it should not be affect the above and below styles.
by
hasvi
Copy link to clipboard
Copied
Do you mean find:
~b~b+
replace with:
\r
You can use this predefined search in ID out-of-box.
or what do you mean???
(If not this, sceenshot with visible hidden characters and more informations please.)
Copy link to clipboard
Copied
Thanks its working
Sent from Yahoo Mail on Android
Copy link to clipboard
Copied
Hi,
app.findGrepPreferences.findWhat = "~b~b+";
app.changeGrepPreferences.changeTo ="\r";
app.activeDocument.changeGrep ();
This script is working for remove extra enter mark in Indesign file, but when its removed that time the enter mark followed para style was changed.
I want to remove the enter mark at the same time I have retained followed para style. Is this possible by script?
by
hasvi
Copy link to clipboard
Copied
@Hasvi ā the script by pixxxelschubser is working.
We need a screenshot with hidden characters showing (a before and after comparison) where it is not working. As I said, for me it is working.
You can include a screenshot with the forum software by using the camera icon:
And with showing hidden characters I mean something like this:
Before running the script:
After running the script:
Uwe
Copy link to clipboard
Copied
Its working fine in non xml file. But its not working in xml file. You need xml file sample?
Sent from Yahoo Mail on Android
Copy link to clipboard
Copied
@Hasvi ā ah, now!
A sample would be fine⦠There should be a solution š
Uwe
Copy link to clipboard
Copied
@hasvi ā I did not realise, that you entered another post before for the same issue. Think, you could have mentioned it. Now it's not necessary to send a new screenshot.
Seems to be best to continue this conversation over there:
hasvi
correct my script 'clear empty enter mark'
May 27, 2014 5:26 AM
https://forums.adobe.com/thread/1483275
Uwe
Copy link to clipboard
Copied
@hasvi
Try this,
var myDoc = app.activeDocument;
app.findGrepPreferences = NothingEnum.nothing;
app.changeGrepPreferences = NothingEnum.nothing;
app.findGrepPreferences.findWhat = "\\r+(?<=\\r)\s*$";
app.changeGrepPreferences.changeTo = "";
app.activeDocument.changeGrep();
app.findGrepPreferences = NothingEnum.nothing;
app.changeGrepPreferences = NothingEnum.nothing;
app.findGrepPreferences.findWhat = "^\r";
app.changeGrepPreferences.changeTo = "";
app.activeDocument.changeGrep();
Hurix
Copy link to clipboard
Copied
hi hurix,
its working fine, but 'app.findGrepPreferences.findWhat = "^\r";' this statement is not retain the paragraph style.
by
hasvi
Copy link to clipboard
Copied
It's recognize Beginning of the character.
Hurix
Copy link to clipboard
Copied
anyhow thanks hurix
Copy link to clipboard
Copied
Hi Hasvi,
You can use this one.
var myDoc = app.documents[0];
app.findGrepPreferences = app.changeGrepPreferences = null;
try {
app.findGrepPreferences.findWhat = "^\\r";
app.changeGrepPreferences.changeTo = "";
var found_enter_mark = myDoc.findGrep();
for (var i = found_enter_mark.length - 1; i >= 0; i--) {
var first_paragraph = found_enter_mark[i].paragraphs.firstItem();
var next_paragraph = first_paragraph.paragraphs[-1].insertionPoints[-1].paragraphs[0];
first_paragraph.appliedParagraphStyle = next_paragraph.appliedParagraphStyle;
}
myDoc.changeGrep();
}
catch (e) { }
app.findGrepPreferences = app.changeGrepPreferences = null;
Copy link to clipboard
Copied
Hi @SumitKumar , Itās easy to miss, but this thread is 9 years old, so I doubt @hasvi is going to see your reply.
Copy link to clipboard
Copied
Goes for me, too š
Copy link to clipboard
Copied
You get the problems with changing styles because of the \r that's replaced. So you should leave alone the first \r in a series and remove any following ones. You can do this with the following query:
Find what: \r\K\r+
Change to: <leave empty>