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

How to get the stroke size of a shape layer.

Explorer ,
Mar 31, 2024 Mar 31, 2024

How to get the stroke size of a shape layer in Photoshop? For example, if the current rectangle tool creates a shape layer with a stroke size of 30 pixels, how can I retrieve this information?

TOPICS
Actions and scripting
338
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

People's Champ , Mar 31, 2024 Mar 31, 2024
try {

// Works only in Photoshop CC

var the_layer = activeDocument.activeLayer;

var r = new ActionReference();
r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("AGMStrokeStyleInfo"));
r.putIdentifier(stringIDToTypeID("layer"), the_layer.id);

var ret = executeActionGet(r).getObjectValue(stringIDToTypeID("AGMStrokeStyleInfo")).getUnitDoubleValue(stringIDToTypeID("strokeStyleLineWidth"));

alert(ret);

} catch (e) { alert(e.line+ "\n\n" +e); }
Translate
Adobe
People's Champ ,
Mar 31, 2024 Mar 31, 2024
try {

// Works only in Photoshop CC

var the_layer = activeDocument.activeLayer;

var r = new ActionReference();
r.putProperty(stringIDToTypeID("property"), stringIDToTypeID("AGMStrokeStyleInfo"));
r.putIdentifier(stringIDToTypeID("layer"), the_layer.id);

var ret = executeActionGet(r).getObjectValue(stringIDToTypeID("AGMStrokeStyleInfo")).getUnitDoubleValue(stringIDToTypeID("strokeStyleLineWidth"));

alert(ret);

} catch (e) { alert(e.line+ "\n\n" +e); }
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
Explorer ,
Mar 31, 2024 Mar 31, 2024
LATEST

Thank you, you are really

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