Copy link to clipboard
Copied
I have a task to solve and I don't know how to write a condition. Maybe you can help : "Create a script that detects if the image uses a color profile. If used, the script should report the name. If not used, it must inform the user that does not use color profile".
Copy link to clipboard
Copied
Try this:
if (app.activeDocument.colorProfileType == ColorProfileType.NONE) {
alert("This image does not have a Color Profile");
} else {
alert("The Color Profile of this image is: " + doc.colorProfileName);
}
Copy link to clipboard
Copied
Hi Polkomatik,
Try this...
CHK_Profile();
function CHK_Profile(){
var doc = app.activeDocument;
var myDocname=doc.name
try {
var ecp=doc.colorProfileName;
alert("The Color Profile is - " + doc.colorProfileName);
}
catch (er) {
alert("The Image has untagged color profile.. !!!\n\n");
}
}