Sorry, but it is necessary as I have STYLES on my paragraphs. If I do a normal search and replace, replacing the two with one the PARAGRAPH STYLE is lost! If you have mixed styles the styles get all wrong. Try it and see for yourself. The "style" of a paragraph is "attached" to the "return" and a search and replace on it ruins the style setting. This doc is hundreds of pages and has tons of styles.
I was aware of that. My suggestion was on the off chance you were in the vast majority of people here who do not use styles.
Experiment with inserting a 3rd para or other character, then eliminating the spare elements, to see if you can get past the limitations.
Also try structuring your styles so there is a "Next Style" to every style.
I'm curious as to why you are cleaning your text after styling it? Designers usually make it the first step in layout.
I am cleaning the text after styling it because it is a supplied file to me from a customer. I have to prepare it for publication. I had nothing to do with the file creation nor the original styling. So...
I ask again... Does anyone know an Applescript to do what I ask? (or how to globally delete the 2nd return only without losing the Style on the paragraph?)
There is nothing stopping you cleaning the text before opening it in Pages.
The bug with the styling is to my knowledge a Pages bug.
Clean the text elsewhere. The possibilities are TextEdit, Bean and LibreOffice. All free. There are also 3rd party apps like TextSoap.
A bit of advice from a veteran Studio Manager. Most people with a hammer in their hand think that they must use it on everything, including the glassware. Much of my time in studios was getting the staff out of ruts of their own making.
Funny, the same question was asked on 2011/11/12 in http://macscripter.net/viewtopic.php?id=37477
Nigel Garvey posted a neat answer :
tell application "Pages"
delete (paragraphs of front document whose length is 1)
Yvan KOENIG (VALLAURIS, France) lundi 14 janvier 2011 11:01:29
iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
My iDisk is : <http://public.me.com/koenigyvan>
Please : Search for questions similar to your own before submitting them to the community