Copy link to clipboard
Copied
Is there any smart way to uniquely and persistently identify a layer within ExtendScript?
Whats the reason behind this:
I'm writing a CEP extension where the user can make some settings on a layer level that will then be used by the extension later on. Currently I'm saving the configured settings in the XMPMeta data of the file so that the user won't have to configure it each time.
This works great, but the problem is that the I'm currently using either the layer name or the layer index to link the Layer object with the stored meta data. Both of them can and should be modified by the user at free will. This means means I might not be able to correctly assign the stored meta data to the desired layer after next load up. So having a unique persistent identifier would be great.
I've found some older discussions and this user request but hoped that by now there might be a some new information about this. It seems that PageItems already have a uuid property is there something similar for layers?
I could not find any sort of unique key for the layer being added to the DOM. I checked at
https://github.com/docsforadobe/illustrator-scripting-guide
Probably you would have to improvise something. I would say something like a hidden pageitem with some tag set to identify the layer uniquely
-Manan
Copy link to clipboard
Copied
I could not find any sort of unique key for the layer being added to the DOM. I checked at
https://github.com/docsforadobe/illustrator-scripting-guide
Probably you would have to improvise something. I would say something like a hidden pageitem with some tag set to identify the layer uniquely
-Manan