【发布时间】:2019-07-07 07:46:50
【问题描述】:
我正在尝试创建一个 AppleScript,它会在 InDesign 中的每个链接图像上创建超链接。
这是我目前为止的想法。
tell application "Adobe InDesign CC 2017"
activate
tell active document
set grphicBoxs to all graphics of layer activeLayer
set myLinks to {}
repeat with I in grphicBoxs
set iLink to item link of i
set end of myLinks to iLink
end repeat
repeat with theLinkRef in myLinks
set theLinkName to ((name of theLinkRef) as string)
display dialog "theLinkName: " & theLinkName
set myHyperLink to "www.myURL"
set myHyperLinkName to "myURL name"
try
set hyperLinkPreSet to make hyperlink URL destination with properties `{name:myHyperLinkName, destination URL:myHyperLink}`
on error
set hyperLinkPreSet to hyperlink URL destination myHyperLinkName
end try
try
set hyperLinkObject to make hyperlink page item source with properties `{name:myHyperLinkName, source page item:rectangle theLinkName, hidden:false}`
on error
set TheHS to hyperlink page item source myHyperLinkName
end try
display dialog "hyperLinkObject:" & hyperLinkObject
make new hyperlink with properties `{destination:myHyperLink, source:hyperLinkObject, visible:false}`
end repeat
end tell
end tell
预期结果是将创建的超链接预设应用于所选对象。但我收到此错误消息。
方法“make”的参数“source”的值无效。预期页面 项目,但什么也没收到。
这里有谁成功地在链接对象上创建了超链接可以帮助我吗?
【问题讨论】:
标签: hyperlink applescript adobe-indesign