如何使用Applescript获取图像的颜色配置文件?

时间:2012-11-17 17:30:47

标签: macos applescript

我想写一个收集图像颜色配置文件的苹果脚本..任何人都可以帮我解决这个问题吗?我不知道!!

提前致谢。

1 个答案:

答案 0 :(得分:2)

我喜欢使用ExifTool by Phil Harvey来提取元数据。这是一个service I wrote来快速访问元数据。

on run {input, parameters}
    -- creates a metadata folder in the Documents folder to store results
    set thePath to POSIX path of (path to documents folder) & "metadata" & "/"
    do shell script "mkdir -p " & quoted form of POSIX path of thePath

    set {inputFiles, outputFiles} to {{}, {}}
    repeat with anItem in input
        set end of inputFiles to quoted form of POSIX path of (anItem as text)
        tell application "Finder" to set {name:fileName, name extension:nameExtension} to anItem
        set baseName to text 1 thru ((get offset of "." & nameExtension in fileName) - 1) of fileName
        set end of outputFiles to quoted form of (thePath & baseName & ".txt")
    end repeat

    set {TID, text item delimiters} to {text item delimiters, space}
    set {inputFiles, outputFiles} to {(inputFiles as text), (outputFiles as text)}
    set text item delimiters to TID

    do shell script "exiftool -a " & inputFiles & " -w " & quoted form of (thePath & "%f.txt" as text) & "; open " & outputFiles
end run