AppleScript iPhoto导入命令(如何处理重复项)

时间:2014-10-02 18:15:52

标签: import applescript iphoto

我正在尝试完全自动化将图像导入iPhoto的工作流程。最后一块拼图是处理重复的图像。目前我认为Applescripts import命令无法导入重复项。因此,当副本产生所有工作流程停止并且iPhoto等待输入时。

有没有办法解决这个问题?

1 个答案:

答案 0 :(得分:1)

您需要编写此脚本。这里有一些似乎在applescript编辑器中工作的代码。相应地调整自动机......

set iFolder to (choose folder)

set iFiles to (list folder iFolder)

tell application "iPhoto"
    repeat with iFile in iFiles
        try
            set pFound to get (every photo of album "Photos" whose image filename is iFile)
        end try
        if length of pFound is not 0 then
            log ("File '" & iFile as text) & "' exists..."

            # Move or delete it here
        end if
    end repeat

    # Continue with import
    import from (iFolder as alias)
end tell