【问题标题】:How to make a stay-open applescript for Photoshop CS6如何为 Photoshop CS6 制作保持打开的 AppleScript
【发布时间】:2013-11-13 09:16:30
【问题描述】:

我正在开发一个保持打开(空闲)的小程序来监视文件夹并处理每个传入的项目。但是,如果有的话,我无法遍历传入的文件。如何解决这个问题?

on idle
    tell application "Finder"

        -- Folders
        set InFolder to "Macintosh HD:Users:Nick:Documents:Applescript:Beeld bewerken:In:"
        set OutFolder to "Macintosh HD:Users:Nick:Documents:Applescript:Beeld bewerken:Out:"

        set MyFiles to (every file in folder ((InFolder) as text))
        set MyFiles to MyFiles as list

        set NumberOfFiles to (number of files in folder ((InFolder) as text))

    end tell

    if NumberOfFiles > 0 then
        repeat with i in MyFiles
            tell application "Adobe Photoshop CS6"

                open (item i of MyFiles)

                -- Edit item

            end tell
        end repeat
    end if
    return 10
end idle

【问题讨论】:

    标签: applescript photoshop


    【解决方案1】:

    看起来您应该使用文件夹操作而不是空闲处理程序。将此文件夹操作附加到您的目标文件夹。

    on adding folder items to theFolder after receiving droppedItems
        repeat with anItem in droppedItems
            tell application "Adobe Photoshop CS6" to open anItem
        end repeat
    end adding folder items to
    

    【讨论】:

      猜你喜欢
      • 2023-03-30
      • 1970-01-01
      • 1970-01-01
      • 2014-05-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-06-01
      相关资源
      最近更新 更多