Reputation: 117
I'm making a book about quotes. Got in the thousands of them. They all apear like this:
Patience is a tree whose root is bitter, but its fruit very sweet. Persian proverb
And I would like to make them appear like this
Patience is a tree whose root is bitter, but its fruit very sweet.
Persian proverb
So I basically need the program to understand that when the text ends with regular, then have a space and then there is italic the space needs to be converted into a paragraph enter (^p). Don't know the exact word for it...
Something in Applescript would be appreciated!
BTW: I use quotes that are made out of many sentences as well.
Upvotes: 1
Views: 651
Reputation: 2440
From what you've said, it sounds like you can do this with Find/Change. No AppleScript needed.
This worked for me, in InDesign CS6.
Doing a GREP match means that "Find what" is a regular expression. We're using .+$
for our expression. Let's break that expression down:
.+
will match a sequence of one or more characters $
matches the end of a paragraph.For "Change to" you want \r$0
.
\r
creates a new paragraph$0
is the text you matched in "Find what." After you do "Change All" you'll have your italic text in new paragraphs. But some of those paragraphs may start with a space character (if the space was in italics, and matched by the previous "Find What"). You can clean that up with another GREP match.
^
(caret, then space). The caret matches the start of a paragraph. So we're finding all spaces at the start of a paragraph.Upvotes: 1