Photoshop CS6 中的 Applescript:无法保存 JPEG!为什么?

Applescript in Photoshop CS6: can't save a JPEG! WHY?

我在这里写了一个非常非常简单的脚本 droplet。我用它在 运行 一个动作后将 PDF 转换为 jpg。我只是将 PDF 拖到 droplet 上。

完成后,没有文件被保存。曾经。我试过 POSIX、引用形式、从服务器保存、从我的桌面保存、不同的语法……都没有用。无论我做什么,Photoshop 都不会保存该死的文件。我什至从指南中复制了完全相同的代码,但没有效果。

 on open myItems
    repeat with thisItem in myItems
        tell application "System Events"
            set targetFolderPath to path of container of disk item (thisItem as text)
        end tell


        tell application "Adobe Photoshop CS6"
            set display dialogs to never
            open thisItem as PDF with options ¬
                {class:PDF open options, mode:RGB, resolution:180, use antialias:true, crop page:crop box}

            set myDoc to name of current document
            set filePath to targetFolderPath & myDoc & ".jpg"

            do action "MyAction" from "Default"

            save in file filePath as JPEG with options {quality:12}
            close the current document saving no
        end tell
 end open

尝试

save in file filePath as JPEG with options {class:JPEG save options, quality:12}

给定的选项需要声明为 JPEG 保存选项!

尝试保存透明胶片时可能会出现另一个问题,但我认为 Photoshop 会在将图像保存为 Jpeg 时踢掉它们!

干杯,迈克尔/汉堡