Getting the names of all installed ICC profiles

In an automatisation project, we do need the list of the names of the installed ICC profiles (so that we can assign a selected profile to the current image in Photoshop.

So far, I have not found a reliable way to get this information.

Image Events does list some profiles, but only the ones in /Systems/Library.

The ColorSync utility is not Applescriptable.

The name and the file name may or may not be the same.

There are some more than 10 year old scripts floating around, but I can’t get them to work…

I am stuck (OK, it could be my limited experience). Any help, hint etc. is highly appreciated.

A possible workaround I figured out in the meantime, seems to be to loop through the “usual suspects” (the directories where the ICC profiles are stored), and use Exiftool to extract the ProfileDescription tag. This can then be put in a list and made available for selection.

maxwyss. You’ve arrived at what appears to be a good solution, but I thought I’d make a few comments FWIW.

As you note, Image Events will return profile names for what appears to be a default folder but no others. I tried using the “profile folder” property but couldn’t get that to work. I was also unsuccessful in getting profile names with ASObjC.

As you also note, exiftool does work and, in my testing, is actually reasonably quick when used in batch processing mode. I’ve included a script suggestion below just to demonstrate how this might work. It returns a list of lists with each sublist containing the profile name and then its POSIX path. You may only need the profile names, in which case the repeat loop can be simplified.

set targetFolders to {"/System/Library/ColorSync/Profiles/", "/Library/ColorSync/Profiles/"}
repeat with aFolder in targetFolders
	set contents of aFolder to (quoted form of aFolder) & space
end repeat

set profileData to paragraphs of (do shell script "/usr/local/bin/exiftool -profiledescription -ext icc " & targetFolders)

set TID to text item delimiters
set text item delimiters to {"= ", ": "}
set profileList to {}
repeat with i from 1 to (count profileData)
	if item i of profileData begins with "Profile Description" then
		set end of profileList to {text item -1 of item i of profileData, text item -1 of item (i - 1) of profileData}
	end if
end repeat
set text item delimiters to TID

1 Like

Thanks a lot for the comments. This is a more elegant approach as I had planned.