插画师CC 2020苹果脚本(弹出窗口"Select File Format")



因为我在苹果脚本中执行此命令时将插画师更新为 CC 2020 (24.0(

set placedRef to make new placed item in layer "Layer1" of current document with properties {file path:pfilepath} without dialogs

Illustrator显示一个弹出窗口:"选择文件格式以打开文件:"有3个选项:Pixar,PNG或Targa。 无论我选择什么,都不会插入任何东西。

这个完全相同的命令适用于插画师CC 2019,但不显示弹出窗口。

这是要重现的完整代码:

on run argv
tell application "Adobe Illustrator"
activate
set user interaction level to never interact
set placedRef to make new placed item in layer "ignore" of current document with properties {file path:item 1 of argv} without dialogs
end tell
end run

运行脚本的命令示例:

osascript test.scpt :Users:myusername:Download:test.pdf

>AI 2020 已将file path属性的类型从"file"值更改为 POSIX 路径字符串,从而破坏了与现有脚本的兼容性(更多信息(。更改 shell 脚本以改为传递 POSIX 路径。

最新更新