【问题标题】:Applescript in Photoshop CS6: can't save a JPEG! WHY?Photoshop CS6 中的 Applescript:无法保存 JPEG!为什么?
【发布时间】:2023-03-30 04:20:01
【问题描述】:

我在这里写了一个非常非常简单的脚本小滴。运行操作后,我使用它将 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

【问题讨论】:

    标签: applescript photoshop


    【解决方案1】:

    试试

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

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

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

    干杯,迈克尔/汉堡

    【讨论】:

    • OMG 我发现了你的错误:你没有告诉 Photoshop 保存文档,你只是说 SAVE 没有目标。请尝试save current document in file filePath as JPEG with options {class:JPEG save options, quality:12} - 对不起,我瞎了眼,指错了方向!迈克尔
    • 我只是发现了问题所在,然后来这里看看你发现了同样的事情。你是对的:你告诉当前文档保存——而不是应用程序。
    猜你喜欢
    • 1970-01-01
    • 2016-07-03
    • 1970-01-01
    • 2016-12-26
    • 2014-05-16
    • 1970-01-01
    • 1970-01-01
    • 2020-07-27
    • 2022-12-12
    相关资源
    最近更新 更多