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

Google chrome Adobe Illustrator在浏览器快捷方式中打开文件,google-chrome,browser,keyboard-shortcuts,adobe-illustrator,Google Chrome,Browser,Keyboard Shortcuts,Adobe Illustrator,有没有一种方法可以让我在Adobe Illustrator的internet浏览器(特别是Chrome浏览器)中使用快捷方式打开正在处理的文件?好的,这里有一种使用AppleScript的方法。将以下内容粘贴到AppleScript编辑器中,并将其保存为/Applications/Adobe Illustrator/Presets/Scripts文件夹中的“View SVG in Chrome.scpt” set tmpfile to "/tmp/ai-temp-" & ((random

有没有一种方法可以让我在Adobe Illustrator的internet浏览器(特别是Chrome浏览器)中使用快捷方式打开正在处理的文件?

好的,这里有一种使用AppleScript的方法。将以下内容粘贴到AppleScript编辑器中,并将其保存为/Applications/Adobe Illustrator/Presets/Scripts文件夹中的“View SVG in Chrome.scpt”

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,脚本应出现在文件»脚本菜单中

有几点需要注意:

  • Illustrator CS2是我拥有的最新版本。在以后的版本中,情况可能会有所改变,不过应该可以让这个脚本顺利运行。我认为在Adobe,脚本编写的优先级很低,所以如果什么都没有改变,我也不会感到惊讶

  • 脚本保存当前文件,将图像导出到Chrome,然后重新打开您正在处理的文件。这是不可避免的,因为Illustrator的AppleScript API不允许您将文件副本保存到其他位置

  • 我在这里假设您希望将文件导出为SVG图像,但也可以使用其他格式;只需将上述脚本中的
    SVG
    替换为
    Flash
    GIF
    JPEG
    Photoshop
    PNG24
    PNG8

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