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

How to get shape layers? (whitout select adjustements layers)

Community Beginner ,
Feb 26, 2015 Feb 26, 2015

Copy link to clipboard

Copied

Hi,

Shape layers and Adjustement Layer "Color fill" shares the same LayerKind. How can I difference them?

ShapeLayerObject.kind == LayerKind.SOLIDFILL // true

ColorFillLayerObject.kind == LayerKind.SOLIDFILL // true

Thanks !

TOPICS
Actions and scripting

Views

256

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
Adobe
Enthusiast ,
Feb 26, 2015 Feb 26, 2015

Copy link to clipboard

Copied

You can check to see if it has a vector mask.

alert(isShapeLayer());

function isShapeLayer(){

var ref = new ActionReference();

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

desc =  executeActionGet(ref);

if(!desc.hasKey(stringIDToTypeID('adjustment')) ) return false;

if(desc.getBoolean(stringIDToTypeID('hasVectorMask' )) == true)  return true;

return false;

};

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
Community Beginner ,
Feb 26, 2015 Feb 26, 2015

Copy link to clipboard

Copied

LATEST

Thanks! I'll use this function .

Anyway I have the same "problem" again and again... AM seems to work just with activeLayer and I like to work with objects layers.

Thanks!

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