[我正在尝试使用do script
和[interweb]上的Adobe InDesign Scripting Guide中所述的this page命令通过AppleScript打开和执行JSX脚本:
do script
方法为脚本提供了执行另一个脚本的方法。该脚本可以是有效脚本代码的字符串,也可以是磁盘上的文件。
script.scpt:
tell application "Adobe InDesign 2020"
activate
set jsx_script to "Macintosh HD:Users:xxx:project:script.jsx"
set val_1 to "Foo"
set val_1 to "Bar"
set my_values to {val_1, val_2}
do script jsx_script language javascript with arguments my_values
end tell
script.jsx:
#target "InDesign"
testFunc(arguments);
function testFunc(t) {
alert('argument one: ' + t[0] + '\r' + 'argument two: ' + t[1]);
}
但是它不起作用。我收到“预期的行尾等,但找到“脚本”。”语法错误。这是否意味着不再支持do script
?我的环境是macOS 10.15.3和InDesign 2020(15.0.2)。感谢您的指导。
问题通过更新到macOS 10.15.4解决了。