javascript - Undefined colour profile -
I am trying to remove color profiles from a document. As far as I know, the color profile file name must either be a string or empty (if it is not assigned) However, if it is later, I can not specify it in a variable (line 3).
Is there a way on this without trying / catches?
try {var cp = app.activeDocument.colorProfileName; } Catch (eek) {warning ("no color profile associated with image added"); Cp = null; } If (cp! = Null) {cp = Assign Collar Profile (CP); If (cp == faucet) {Warning ("now color profile has been removed"); I only have access to Photoshop CS5 and color details profile name says:
Valid only when the color profile = type = color profile Custom or working.
So maybe it's a good idea to check in advance:
var CP = null; If (app.activeDocument.colorProfileType! = ColorProfile.NONE) CP = app.activeDocument.colorProfileName;
Michael / Hamburg
Comments
Post a Comment