How does one embed/set a ICC profile/color space into an image using apple script?

How do I get an ICC profile into a form I can embed into an image using Apple Script/Image Events?

I'm using the form below

make new profile with properties {location:"Macintosh HD/Users/user_N/Desktop/sRGB Profile.icc"}"
embed this_image with source profile

I've also tried setting the color space property of the image.

set the color space of this_image to RGB

of course there is more to the code but that is just the part I'm having issues with. I get the error message "Image got an error: can't make profile into type profile" and, error "The variable profile is not defined." number -2753 from "profile"

What am I missing here, Anyone know?

Replies

You can embed profile with "embed this_image with source" command. And..."profile" have to be an actual profile.

Your code seems to use undeclared variable "profile". You have to set some ICC profile to other variable such as "myProfile". Then.....

embed this_image with source myProfile

will be executed.

AppleScript's rexical coloring is important function to write AppleScript. Apple's default color setting is nightmare. It can not detect some different rexical elements.

This is my rexical coloring in Script Editor. It can detect the difference of each rexical elements.

http://piyocast.com/as/wp-content/uploads/2018/02/edf39d5e74f06d49cbe0d21a20cffb75-660x1024.png