Looking for Pages script to find "return" "return" and delete 2nd one only
Looking for a Pages Applescript to find "return" "return" and delete 2nd one only. Perform on entire document.
Thanks
Looking for a Pages Applescript to find "return" "return" and delete 2nd one only. Perform on entire document.
Thanks
Hardly necessary.
Menu > Edit > Find > Find… > Find: Advanced > Insert… > ParagraphBreak ParagraphBreak > In: Entire Document > Replace: > ParagraphBreak
You can also copy and paste in an example of what you want to find.
Peter
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.
Peter
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.
Peter
Funny, the same question was asked on 2011/11/12 in http://macscripter.net/viewtopic.php?id=37477
Nigel Garvey posted a neat answer :
--{code}
tell application "Pages"
delete (paragraphs of front document whose length is 1)
end tell
--{code}
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
A perfert answer to my question! Thanks much.
Looking for Pages script to find "return" "return" and delete 2nd one only