Hi Guys,
I am trying to get the info(font, color, alignment etc.) of text kind layer in Photoshop CC. My script is as follows,
var textLayer = activeDocument.activeLayer.textItem;
var fontName = textLayer.font;
try{
var textColor = "R: " + textLayer.color.rgb.red + " G: " + textLayer.color.rgb.green + " B: " + textLayer.color.rgb.blue;
}
catch(e){alert(e);}
try
{
var textAlignment = textLayer.justification.toString();
}
catch(e){alert(e);}
On setting the color value R - 0, B - 0 and G - 0 or alignment 'Left' and create a text layer after this. I encountered an error
"Error: General Photshop error occurred. This functionality may not be available in this version of Photoshop.
- <no additional information available> "
If I set some other color value and other alignment and create the text and get its info, script works fine.
Or If I change the values and revert it back to 'Left' alignment and R-0, B-0 and G-0 then I am able to get the values with the above script.
I get this error at first time only and after that script works fine
I also run this script with CS5 version, Its working fine there. But I don't know why I am getting this error in CC version.
Am I doing something wrong here or Is it some issue with Photoshop CC.
Any help would be appriciated.
Thanks..