Feature parity - Plugin data on layer nodes in PS

Would you mind sharing how you do that? In Alchemist Generator returns 0.json, so I figured I have to set my metadata to this json property, but I can’t figure out what’s the descriptor to set it. Also not sure how this is per layer :thinking:

What I’m doing now:

const jsonData = getDocumentProperty(docId, "json")
const json = JSON.parse(jsonData)

json["myPluginMeta"] = data

execModal(() => bp(
    [{
        "_obj": "set",
        "_target": [{
            "_ref": "document",
            "_id": docId,
            "_property": "json"
        }],
        "to": {
            "_obj": "document",
            "json": JSON.stringify(json)
        }
    }],
    {
        "synchronousExecution": true,
        "modalBehavior": "execute"
    })
)

Catching errors, but nothing there. And updated JSON is not set (checked descriptor and myPluginMeta key is there, but nada). Also I would even prefer having my meta saved on document level with object, where keys would be layer IDs. Would prefer not having to deal with XML

1 Like