自动化 InDesign 以在新段落中放置斜体文本 [英] Automating InDesign to place italicized text in a new paragraph
问题描述
我正在制作一本关于报价的书.得到了成千上万的人.他们都是这样的:
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
所以我基本上需要程序明白,当文本以正则结尾时,然后有一个空格,然后有斜体空格需要转换为段落回车(^p).不知道确切的词...
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...
Applescript 中的某些内容将不胜感激!
Something in Applescript would be appreciated!
顺便说一句:我也使用由许多句子组成的引号.
BTW: I use quotes that are made out of many sentences as well.
推荐答案
根据您所说的,听起来您可以使用查找/更改"来做到这一点.不需要 AppleScript.
From what you've said, it sounds like you can do this with Find/Change. No AppleScript needed.
这对我有用,在 InDesign CS6 中.
This worked for me, in InDesign CS6.
进行 GREP 匹配意味着查找内容"是 正则表达式.我们使用 .+$
作为我们的表达式.让我们分解一下这个表达式:
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.- The find format will only match text that's in italics. (Hopefully you used character styles for the attributions; if so, use your style instead.)
- Putting it all together, we're finding everything that's in italics at the end of a paragraph. If there are no italics at the end of a paragraph, we won't match anything.
对于更改为"你想要\r$0
.
\r
创建一个新段落$0
是您在查找内容"中匹配的文本.- 因此,您将在匹配的斜体文本之前添加一个新段落.
\r
creates a new paragraph$0
is the text you matched in "Find what."- So you'll end up with a new paragraph before the italicized text you matched.
执行全部更改"后,您将在新段落中使用斜体文本.但其中一些段落可能以空格字符开头(如果空格是斜体,并且与前面的查找内容"匹配).你可以用另一个 GREP 匹配来清理它.
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.
- 查找内容:
^
(插入符号,然后是空格).插入符号匹配段落的开头.所以我们找到了段落开头的所有空格. - 更改为:空.
- 这将删除段落开头的所有空格.
- Find What:
^
(caret, then space). The caret matches the start of a paragraph. So we're finding all spaces at the start of a paragraph. - Change to: empty.
- This will remove all spaces that are at the start of a paragraph.
这篇关于自动化 InDesign 以在新段落中放置斜体文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!