【发布时间】:2020-02-02 21:24:05
【问题描述】:
我目前有一个 AppleScript,可以对 indesign 文档中的文本框进行小幅更改。脚本逐页进行,如果应用的对象样式被称为某个名称并且包含某个字符,它将应用段落样式。这是我的脚本示例:
tell application "Adobe InDesign"
repeat with x from 1 to count pages
set ThisPage to page x
tell ThisPage
if exists (text frames whose (name of applied object style is "PriceBox" and contents contains "/$")) then
set myFrames to (text frames whose (name of applied object style is "PriceBox" and contents contains "/$"))
tell myFrames
repeat with r from 1 to count items
set applied paragraph style of paragraphs of item r of myFrames to "2forPrice"
end repeat
end tell
end if
end tell
end repeat
end tell
它的作用是转到文档的第一页,如果有一个名为“PriceBox”的文本框并且该文本框中有字符“/$”,它将改变段落样式到命名样式“2forPrice”。
当每个页面上有 1 个“列表”时,这非常有用。我正在尝试在有多组列表的情况下进行这项工作,并使脚本分别转到每组框并运行脚本。有什么方法可以判断这是否可以按组而不是按页面完成?
感谢您的帮助!!
更新: 这是它的截图,我跳过了几个步骤来让它工作,但我更喜欢使用盒子组。
图1:这就是所谓的“组”,我想把所有这些盒子放在一个组中。
图2:这是所有组在一个页面上的布局方式
图3:如果是“2for”的话,看看价格的变化,例如2/$6
我希望我的脚本按组而不是逐页执行 if 语句并更改段落样式。再次感谢您的帮助!
【问题讨论】:
标签: applescript adobe adobe-indesign