0
我试图从文档中移除颜色配置文件。据我所知,colorProfileName应该是一个字符串或null(如果它没有被分配)。但是,如果是后者,我不能将它分配给一个变量(第3行)。未定义的颜色配置文件
没有try/catch有没有办法解决这个问题?
try {
var cp = app.activeDocument.colorProfileName;
} catch(eek) {
alert("no colour profile associated with image");
cp = null;
}
if (cp != null) {
cp = assignNoColourProfile(cp);
if (cp == null) {
alert("colour profile now removed");
}
}