ImageInfo Question

I purchased ImageInfo for OS X and think it is pretty cool, but I have a question for anyone who is familiar with it. When I get the image color mode I want the data to be a string, but anytime I try to coerce it to a string it turns out as <<constant ****cmyk>>. Occasionally it will work and return just CMYK like I want. Is there a way that I can get the results I want more consistantly?

Thanks,
Dave


What type of result is being returned for color mode? If it’s a record or list, you might need to jump through some hoops to coerce/convert it to a string.

From the Image Info dictionary
image color mode bitmap/grayscale/indexed/duotone/multichannel/YCbCr/Lab/RGB/CMYK [r/o]

Thanks,
Dave

I just did a couple of tests and this worked for me for a couple of different modes.

tell application "Image Info"
	set theMode to image color mode of (Image Info for alias "path:to:some:file")
	set theMode to theMode as text
end tell

I don’t work with images much so I’m not familiar with many aspects of them. Is it possible that some images can have more than one color mode?

I tried your sample code…

and still got the same results…<<constant ****cmyk>>

No, an image would be one of the items listed in the dictionary. I guess I’ll just have to build in some testing of the results.

Thanks,
Dave

What happens if you take the coercion out of the Image Info tell block? This would take it out of Image Info’s namespace where, hopefully, it isn’t viewed as a constant.

tell application "Image Info" 
   set theMode to image color mode of (Image Info for alias "path:to:some:file") 
end tell 

set theMode to theMode as text