Edited at


More than 1 year has passed since last update.




16 space: CMYK
16 profile: Japan Color 2011 Coated
16 format: psd
16 bitsPerSample: 8


use AppleScript version "2.4"

use scripting additions
use framework "Foundation"

tell application "Finder"
set {myFiles, myResList, myResultText, myResult, myDelim} to {{}, {}, "", "", "\" \""}
set mySel to selection

repeat with i in mySel
set myPath to POSIX path of (i as alias)
if (class of i) is folder then
set myResList to myResList & digFolder(myPath) of me
set myResList to myResList & myPath
end if
end repeat

set myResultText to "\"" & retStrFromArrayWithDelimiter(myResList, myDelim) of me & "\""
set myResult to "ファイル数:" & (count of myResList) & return & (do shell script "sips -g format -g space -g profile -g bitsPerSample " & myResultText & " | sed -e 's:^/.*$::g' -e '/^$/d' | sort -br | uniq -c | sed -e 's:^ *::g' ")
log myResult -- 単体で使うにはdisplay alertなどにする
end tell

(* ここからサブ *)

on digFolder(myPath)
set digItem to do shell script "find " & quoted form of myPath & " -type f ! -name '.*' | sed -e 's://:/:g'"
return every paragraph of digItem
end digFolder

-- 以下ぴよまるより

on retStrFromArrayWithDelimiter(aList, aDelim)
set anArray to current application's NSArray's arrayWithArray:aList
set aRes to anArray's componentsJoinedByString:aDelim
return aRes as text
end retStrFromArrayWithDelimiter