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

时间:2015-02-27 00:37:16

标签: applescript photoshop

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

完成后,不保存任何文件。永远。我已经尝试过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

1 个答案:

答案 0 :(得分:2)

尝试

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

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

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

干杯,迈克尔/汉堡