【发布时间】:2016-08-21 22:21:41
【问题描述】:
我一直在关注 Adobe InDesign CS6 AppleScript 脚本指南,我正在尝试更改我设置的文本。
目前它可以工作,但它只会将确切的字符串“Apple”更改为“Pear”
是否可以将 findword 设置为“apple”、“fruit”等字符串列表。 我尝试将其列为列表,但出现此错误 “设置属性“查找内容”的值无效。预期字符串或无,
另外,当它更改文本时,我想完全清除 indesign 文本框并将其替换为 changeWord
现在,如果在“Apple”之后出现任何内容,例如 Apple123,它会将其更改为“Pear123”。我需要它来清除文本框并将 changeWord 放在文本框中
任何建议将不胜感激,或者只是指向正确的方向。
谢谢!
set findWord to "Apple"
--establish text for change
set changeWord to "Pear"
tell application "Finder" to set indesignFiles to (files of folder "test1" whose name extension is "indd") as alias list
tell application "Adobe InDesign CC 2015"
open indesignFiles
--Clear find text preferences
set find text preferences to nothing
--Clear change text preferences
set change text preferences to nothing
--establish properties for find
set find what of find text preferences to findWord
--establish properties for change
set change to of change text preferences to changeWord
--perform change text operation
tell document 1
change text
end tell
set find text preferences to nothing
set change text preferences to nothing
if modified of active document is true then
tell active document to save
end if
tell active document
export format PDF type to "Macintosh HD:Users:mattsocha:Desktop:Test1:test.pdf" without showing options
end tell
end tell
【问题讨论】:
标签: list applescript adobe-indesign finder