2012-11-17 70 views
0

如何使用Applescript獲取圖像的顏色配置文件?

我想寫一個蘋果腳本,收集圖像的顏色配置文件..任何人都可以請幫助我如何做到這一點?我不知道!!

在此先感謝。

+1

甚至可能有機會想出一個體面的答案,您需要編輯您的問題,以添加更多的細節。 Applescript依賴於您所調用的任何應用程序提供的腳本字典。什麼應用程序打開了此圖像?你會打開另一種方式來獲取圖像的顏色配置文件比使用AppleScript嗎?這是針對你正在從事的應用程序嗎? –

回答

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 
相關問題