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

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

Participant ,
Mar 09, 2025 Mar 09, 2025

Copy link to clipboard

Copied

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

Views

79
Translate

Report

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
Adobe
Community Expert ,
Mar 10, 2025 Mar 10, 2025

Copy link to clipboard

Copied

Please provide the file for testing. 

Votes

Translate

Report

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

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Report

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