Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

This functionality may not be available in this version of Photoshop Error. no additional informatio

Participant ,
Mar 09, 2025 Mar 09, 2025

When I use a script to get text layer information, this line of code colorDesc.getDouble(stringIDToTypeID('red')) throws an error: 

This functionality may not be available in this version of Photoshop Error. no additional information available

javaer_0-1741588119344.png

function get_layer_text_info() {

var ref = new ActionReference();

ref.putEnumerated(charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt"));

var layerDesc = executeActionGet(ref);
var textDesc = layerDesc.getObjectValue(stringIDToTypeID('textKey'));

var layerStyles = textDesc.getList(stringIDToTypeID('textStyleRange'));

var textContents = textDesc.getString(stringIDToTypeID('textKey'));
var textInfoList = [];


alert("layerStyles.count:" + layerStyles.count)


for (var i = 0; i < layerStyles.count; i++) {

var textStyleRange = layerStyles.getObjectValue(i);

var from = textStyleRange.getInteger(stringIDToTypeID('from'));

var to = textStyleRange.getInteger(stringIDToTypeID('to'));


var textStyle = textStyleRange.getObjectValue(stringIDToTypeID('textStyle'));


var color;
if (textStyle.hasKey(stringIDToTypeID("color"))) {


var colorDesc = textStyle.getObjectValue(stringIDToTypeID('color'));

alert("test" )

var red = colorDesc.getDouble(stringIDToTypeID('red'));
var green = colorDesc.getDouble(stringIDToTypeID('green'));
var blue = colorDesc.getDouble(stringIDToTypeID('blue'));
color = red + "," + green + "," + blue;
} else {
color = null;
}

}

TOPICS
Actions and scripting , Windows
246
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Mar 12, 2025 Mar 12, 2025

The reason has been found, it's because some keys do not exist.For example, red and size.

Translate
Adobe
Community Expert ,
Mar 10, 2025 Mar 10, 2025

Please provide the file for testing. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 12, 2025 Mar 12, 2025
LATEST

The reason has been found, it's because some keys do not exist.For example, red and size.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines