Trying To Get Layer Kind

export enum LayerKind {
  any = 0,
  pixel = 1,
  adjustment = 2,
  text = 3,
  vector = 4,
  smartObject = 5,
  video = 6,
  group = 7,
  threeD = 8,
  gradient = 9,
  pattern = 10,
  solidColor = 11,
  background = 12,
  groupEnd = 13
}

Groups actually occupy two layer spaces internally (group start and group end), so if that’s your setup…
image
…the layerKind at indices 0-3 would be
0: Pixel (LayerKind 1)
1: Group End (LayerKind 13)
2: Group (LayerKind 7)

Seems like backgrounds only result in LayerKind 12 when they’re the only layer in the document

2 Likes