Adobe Illustrator在浏览器快捷方式中打开文件

时间:2013-12-18 21:36:48

标签: google-chrome browser keyboard-shortcuts adobe-illustrator

我有没有办法在Adobe Illustrator的互联网浏览器(特别是Chrome)中打开我正在处理的文件的快捷方式?

1 个答案:

答案 0 :(得分:1)

好的,这是使用AppleScript进行此操作的一种方法。将以下内容粘贴到AppleScript编辑器中,并将其另存为/ Applications / Adob​​e Illustrator / Presets / Scripts文件夹中的“在Chrome.scpt中查看SVG”。

set tmpfile to "/tmp/ai-temp-" & ((random number) as string) & ".svg"
tell application "Adobe Illustrator"
    activate
    save the current document
    set openDoc to file path of current document as alias
    export current document to tmpfile as SVG
end tell
tell application "Google Chrome"
    activate
    open location "file://" & tmpfile
end tell
tell application "Adobe Illustrator"
    close current document
    open openDoc
end tell

重新启动Illustrator,脚本应出现在 File » Scripts 菜单中。

一些警告:

  1. 这适用于Illustrator CS2,这是我拥有的最新版本。在以后的版本中,事情可能已经移动了一些,尽管应该可以让这个脚本正常运行而不会有太多麻烦。我认为脚本编写在Adobe是一个低优先级,所以如果没有任何改变,我也不会感到惊讶。

  2. 该脚本会保存当前文件,将图像导出到Chrome,然后重新打开您正在处理的文件。由于Illustrator的AppleScript API不允许您将文件副本保存在其他位置,因此这种说法是不可避免的。

  3. 我假设您要将文件导出为SVG图像,但其他格式也可以;只需使用SVGFlashGIFJPEGPhotoshopPNG24中的一个替换上述脚本中的PNG8

  4. 我没有检查错误,因此,例如,当您运行脚本时,Illustrator当前没有任何文件打开时,可能会发生意外情况。