Best way to store document/layer specific data

I’m trying to store a variable (string or an object) inside a Photoshop Document. in a way that allows the data to be moved with the document without attaching extra files.

I tried defining a property inside the active document object but it only works in active session and gets erased once document is closed.

do I have to use “File info” to store my data? or is there a cleaner way?

I was also wondering if it’s possible to attach a variable to a single layer.

It’s possible using XMPMetadata:
Document: Document XMP metadata - #3 by DavideBarranca
Layer: Photoshop UXP plugin + XMPMetadata - #2 by simonhenke


much more complicated than I anticipated but much appreciated, this seems like the right way.

1 Like