I am unable to figure out how to get a ICC profile to be embeded or matched using Image Events Applescript.
I would have thought this would work:
set this_file to choose file
with timeout of 180 seconds
tell application "Image Events"
launch
try
set this_image to open this_file
on error errMessage
return "Error Opening " & this_file & errMessage as text
end try
get default RGB profile location --as text
--set def_RGB to result as string
set the image_props to the properties of this_image
tell this_image
copy dimensions to the {the_width, the_height}
set file_type to file type
set color_space to color space
set bit_depth to bit depth
set res to resolution
--set display_moniter to name of display profile
end tell
set the_comment to "Image information:" & return & "File Type: " & file_type & return & ¬
"Width: " & the_width & "Height: " & the_height & return & ¬
"Resolution: " & res & return & ¬
"Color Space: " & color_space & return & ¬
"Bit depth: " & bit_depth & return as string
tell application "Finder" to set comment of this_file to the_comment
try
--tell this_image
embed this_image with source default RGB profile
--end tell
--match this_image to destination default RGB profile
on error errMessage
close this_image
return "Error ICC Profile: " & errMessage
end try
try
scale this_image to size 500
on error errMessage
return "Error Sizing " & this_file & errMessage as text
end try
try
set the W500_image to save this_image as JPEG in file newJPG_name of folder Target with icon
on error errMessage
return "Error Saving " & this_file as text
end try
close this_image
set path_W500_image to dest_500 --as alias
end tell
end timeout
I am able to get sips working from the command line:
sips ~/Pictures/Chooseanimage.tif --setProperty format tiff --matchTo /Library/ColorSync/Profiles/Apple Studio Display Profile.icc --out ~/Pictures
Note: make sure you check this line before running, you may not have this icc profile