Is there any property on a layer or layerSet that can hold an arbitrary string? The only thing i can find is name, but artist can and will change this, thus trivializing the UID concept
I’ve read through the scripting PDF and can’t really find any property that fits the bill so I was hoping for some clever/hidden solution to this.
Yeah i have given up. There nothing on the layers aside from name. The file info is great for document level stuff, but i needed something per layer. Not a big deal though
When do you need to assign/read the UID?
You could generate them at export time (if that makes sense for your situation) based on their position in the array of Layers
you could also - though this might be evil – force named groups/folders as containers
layer.textItem.contents might be defined even when layer.kind is not LayerKind.TEXT. I have not tried this.
And document.info.keywords is an array of strings, so – a bit awkwardly – you could have a per-layer list of name:author pairs in there (or author:layer/layer/layer… which might be better)