Skip to main content
Legend
April 22, 2019
Answered

Is there description of the numeric 'layerKind' indexes that are available through AM?

  • April 22, 2019
  • 2 replies
  • 3582 views

Hello! For the script to work, I need to analyze the names of the layers of the document. I get a list of all the layers through AM, then in a loop I sort them in array according to desc.getInteger (stringIDToTypeID ('layerKind')). The problem is that layerKind comes in the form of a numeric index and, in case I need to match a specific type of layer in AM with the type of a layer in DOM,  and I need to understand what index it means. Is there description of the numeric 'layerKind' indexes that are available through AM?

This topic has been closed for replies.
Correct answer r-bin

Taken from "C:/Program Files/Adobe/Adobe Photoshop CC 2018/Required/CopyCSSToClipboard.jsx"

// SheetKind definitions from USheet.h

const kAnySheet             = 0;

const kPixelSheet           = 1;

const kAdjustmentSheet      = 2;

const kTextSheet            = 3;

const kVectorSheet          = 4;

const kSmartObjectSheet     = 5;

const kVideoSheet           = 6;

const kLayerGroupSheet      = 7;

const k3DSheet              = 8;

const kGradientSheet        = 9;

const kPatternSheet         = 10;

const kSolidColorSheet      = 11;

const kBackgroundSheet      = 12;

const kHiddenSectionBounder = 13;

2 replies

Known Participant
August 12, 2019

Thanks

r-binCorrect answer
Legend
April 22, 2019

Taken from "C:/Program Files/Adobe/Adobe Photoshop CC 2018/Required/CopyCSSToClipboard.jsx"

// SheetKind definitions from USheet.h

const kAnySheet             = 0;

const kPixelSheet           = 1;

const kAdjustmentSheet      = 2;

const kTextSheet            = 3;

const kVectorSheet          = 4;

const kSmartObjectSheet     = 5;

const kVideoSheet           = 6;

const kLayerGroupSheet      = 7;

const k3DSheet              = 8;

const kGradientSheet        = 9;

const kPatternSheet         = 10;

const kSolidColorSheet      = 11;

const kBackgroundSheet      = 12;

const kHiddenSectionBounder = 13;

Known Participant
April 19, 2023

Do you know when this index was established? This is giving me issues in CS5. It works fine in CC, but when checking the backward compatibility like explained in my other post you helped me with I am getting some errors. 

 

Known Participant
April 19, 2023

Will not work in CS5 and CS6. Also the property "hasBackgroundLayer" is not available (there will be an error). These properties are available with some version of CC, I can't tell which one.


Oh boy, this is gonna be a long process for me haha. Thanks for the help!