Copy link to clipboard
Copied
I am working with the FindChangeList.txt and the script that comes with it to replace common errors in the textfiles I always get. One of those errors is: a hard return too many. Usually this means that after a paragraph there are three returns instead of two returns.
Now in the old days (CS3) I used to find and replace them using \p, but apparently it has changed to ~b (???). The weird thing is that I can find and replace (using the script) manual returns (\n) with normal returns (~b), but I can't find and change those normal returns (~b) at all. I tried it with 'text' and 'grep' and also ~b~b+ nd so on, but nothing works...
So... how can I find and replace three or more returns with two...?
Copy link to clipboard
Copied
You'll want to add a line like:
grep {findWhat:"\r{3,}"} {changeTo:"\r\r"}
to your FindChangeList.txt file. You'll also want to comment out (if you haven't already) the line that says
grep {findWhat:"\r\r+"} {changeTo:"\r"}
to avoid replacing your two returns with one.
Jeff
Copy link to clipboard
Copied
Thanks, I tried it, but it still doesn't work... It's very weird because ALL my other lines in the FindChangeList.txt do work! And when I use the find/change option in InDesign CS4 itself, I can also find and replace all hard returns without any problems (^b with text and ~b with GREP). I really don't understand why the script doesn't work with it...
Copy link to clipboard
Copied
You may have to escape the backslashes, so \\r instead of \r
Peter
Copy link to clipboard
Copied
No, doesn't work either. I just don't get it. I've also been trying to find and replace things like " and ' but that also doesn't work. While it DOES with the normal find/change option! Maybe the script simply can't handle everything...
Copy link to clipboard
Copied
This may be a stupid question. Sorry if it is. Are you sure you're modifying the correct FindChangeList.txt? It needs to be in a folder called FindChangeSupport in the same folder as your script. Or perhaps you copied your CS3 file rather than modifying the CS4 file? They may be structured differently.
Just an idea.
Jeff
Copy link to clipboard
Copied
Not a stupid question at all, but I am using the right file. The other searches/lines DO work. And I've found the file by using the Show in finder option in CS4. So nothing is going wrong in that regard. As said, I can even replace manual (soft) returns with normal ones, but finding the normal ones (and things like " and ' ) is impossible...
I wonder if someone here has a WORKING file with similar searches as I want that could be uploaded here...?
BTW I of course also tried the line that's in the list by default after installing CS4:
grep {find what:"\r\r+"} {change to:"\r"} {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false} Find all double returns and replace with single returns.
Copy link to clipboard
Copied
Well, I am glad there are Applescript AND Javascript samples... because I managed to find and replace soft returns with hard returns with the Javascript and after that I run the Applescript to do the rest (replace double spaces, double tabs and too many hard returns).
But I'm not done yet... because I can't find and replace " and ' . I guess the problem with " is that this is used in the list itself. But even when I type \" or ~", I won't work.
Copy link to clipboard
Copied
Never mind anymore... All my problems are solved by using a script from this topic:
Awesome!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now