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

How to get the stroke size of a shape layer.

Explorer ,
Mar 31, 2024 Mar 31, 2024

Copy link to clipboard

Copied

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

Views

112

Translate

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

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); }

Votes

Translate

Translate
Adobe
People's Champ ,
Mar 31, 2024 Mar 31, 2024

Copy link to clipboard

Copied

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); }

Votes

Translate

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
Explorer ,
Mar 31, 2024 Mar 31, 2024

Copy link to clipboard

Copied

LATEST

Thank you, you are really

Votes

Translate

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